Subject Re: [IBO] Transaction with master-child relationship
Author Alfred Seetoh
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 10:29 AM 8/12/2003 +0000, you wrote:
> >--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> > > At 09:53 AM 8/12/2003 +0000, you wrote:
> > >
> > >
> > > >KeyLinks of QueryAddress:
> > > > ADDRESS.ID
> > > > ADDRESS.ADDRESS_TYPE
> > > >
> > > >KeySource: *Blank*
> > > >
> > > >MasterSource: DSCustomer
> > > >MasterLinks: ADDRESS.ID=CUSTOMER.CUST_ID
> > >
> > > Do you have the RequestLive property set true in the detail set?
> >
> >Yes, the RequestLive property for both queries are set to true.
> >Basically the funny part is, why does it work when I use
> >IB_TransactionBar to commit. The rest of the setup should be
correct
> >because I followed the tutorial's setup closely. Weird right?
>
> It only suggests *something* is missing that prevents the detail
rows from
> getting posted until the transaction is finally committed. Does
this occur
> with every detail insert, or just the last one? It could be that
you are
> not calling Post on detail rows that don't get posted in the
OnNewRow event
> for the succeeding insert...what the transaction bar achieves, that
your
> code does not, is to test the NeedToPost properties of all
datasets before
> calling Commit.

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?
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. 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?