Subject Re: [IBO] Transaction with master-child relationship
Author Alfred Seetoh
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 12:21 PM 8/12/2003 +0000, you wrote:
>
>
> >All my detail rows are not inserted.
> >Yes I didn't call Post (in code) on detail rows, but it should have
> >been automatically posted when I move up or down in the grid right?
>
> Yes. That's why I wondered if it only affected a single insert, or
the
> last insert if there were multiple inserts.
>
> >The astrix did change to the right-arrow.
> >
> >Ok I did the following:
> > if TransactionMain.PostPendingCount > 0 then
> >   TransactionMain.PostAll;
> >
> >   TransactionMain.Commit;
> >
> >But it still wouldn't work. However if I replace the
> >TransactionMain.Commit with TransactionMain.ApplyUpdates([]), then
it
> >works.
>
> Then you must be working with CachedUpdates set to true, and that
would
> explain it. Sure, with CachedUpdates, you need to ApplyUpdates to
all of
> the datasets and follow it up with a hard commit.
>
> Post works on a *live* dataset. A cached dataset is not live (even
if you
> set the RequestLive to true...the cachedupdates overrides the
dataset
> property).
>
> >OMG... I really wonder whether I should keep cracking my head
> >thinking how to make it work by calling Commit, or should I just
> >stick with ApplyUpdates. What's the difference between the two
anyway?
>
> ApplyUpdates is the CachedUpdates equivalent of Post for a live
> dataset. It doesn't perform a commit - you must call Commit.
>
> Sheesh, these partial problem descriptions waste people's time.
<sigh>

I sincerely apologize for this, I don't even remember when I set it
to true. If only I notice CacheUpdates is true, all these wouldn't
have happened.

> Helen