Subject Re: [IBO] OnBeforePost called twice (CallStack attached)
Author ehandbury
Also, triggers are called twice which is causing grief for me.

--- In IBObjects@y..., "ehandbury" <ehandbury@h...> wrote:
> Jason, thanks for the answer.
>
> I'm glad that its harmless, but...
> 1) I've got code in the BeforePost that I would prefer to only
run
> once.
> 2) Shouldn't the second call stack scenario (the PostRetaining)
be
> the only Post sequence that's run. Why have the 2 Post sequences at
> all? Couldn't this be optimized?
>
> Eric.
>
> --- In IBObjects@y..., "Jason Wharton" <jwharton@i...> wrote:
> > This should be harmless. It is in the process of doing a
> PostRetaining on
> > the master. It has to do this in order to post the detail dataset.
> >
> > Jason Wharton
> > CPS - Mesa AZ
> > http://www.ibobjects.com
> >
> >
> > ----- Original Message -----
> > From: "ehandbury" <ehandbury@h...>
> > To: <IBObjects@y...>
> > Sent: Tuesday, April 30, 2002 5:21 AM
> > Subject: Re: [IBO] OnBeforePost called twice (CallStack attached)
> >
> >
> > > Hello,
> > >
> > > Here is the Callstack from the 2 calls to OnBeforePost
> > > First:
> > > qrActivityBeforePost(...)
> > > _17652
> > > TIB_Dataset::DoBeforePost
> > > TIB_BDataset::SysPost
> > > TIB_Dataset::Post
> > > TIB_UpdateBar::BtnClick
> > >
> > > Second:
> > > qrActivityBeforePost(...)
> > > _17652
> > > TIB_Dataset::DoBeforePost
> > > TIB_BDataset::SysPost
> > > TIB_Dataset::PostRetaining
> > > TIB_Dataset::SysMasterDataUpdate
> > > TIB_Dataset::SysPost
> > > TIB_BDataset::SysPost
> > > TIB_Dataset::CheckBrowseMode
> > > TIB_Datalink::ProcessStatementEvent
> > >
> > > In both calls to OnBeforePost, the IB_Dataset->State ==
> dssInsert.
> > > The 2nd beforepost call comes right after the first.
> > >
> > > TIA. Eric.
> > >
> > > --- In IBObjects@y..., "Jason Wharton" <jwharton@i...> wrote:
> > > > Not that I know of. I wonder if somehow you are causing it to
> re-
> > > enter the
> > > > post code somehow.
> > > > If you gave us the callstack it sure would help.
> > > >
> > > > Jason Wharton
> > > > CPS - Mesa AZ
> > > > http://www.ibobjects.com
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "ehandbury" <ehandbury@h...>
> > > > To: <IBObjects@y...>
> > > > Sent: Wednesday, April 10, 2002 12:01 AM
> > > > Subject: [IBO] OnBeforePost called twice
> > > >
> > > >
> > > > > Hello,
> > > > >
> > > > > (BCB4, IBO4_2Gc, FB1-796)
> > > > >
> > > > > I have a very basic TIB_Query master/detail relationship,
> and
> > > when
> > > > > I commit any changes the OnBeforePost is called twice.
> > > > >
> > > > > Is there a simple reason why this happens?