Subject Re: [IBO] Transaction with master-child relationship
Author Alfred Seetoh
--- In IBObjects@yahoogroups.com, James Chua <james_027@t...> wrote:
> Alfred Seetoh wrote:
>
> > Hi,
> > I encounter a *scratch-head* reaction with my master-child
> > relationship transaction. My master and child tables are CUSTOMER
and
> > ADDRESS respectively. I've set their relationship according to the
> > TransactionsHandling tutorial lesson 2.
> >
> > Info on child IB_Query:
> > MasterLinks: ADDRESS.ID=CUSTOMER.CUST_ID
> > MasterSource: DSCustomer
> >
> > Both IB_Query are using DMMain.TransactionMain as the
IB_Transaction.
> >
> > In my form, I display a single customer and multiple addresses
(in a
> > TIB_Grid). I have an 'Ok' button that does the following code when
> > clicked:
> > DMMain.TransactionMain.Commit;
> >
> > If I update the master information, and click Ok, it works fine.
> > However if I update the child information, no matter how many
times I
> > click the Ok button, it just won't commit;
> >
> > I then dropped a TIB_TransactionBar component into the form. Then
> > update the child info, click the Commit button of the
> > TIB_TransactionBar, and it works.
> >
> > Anybody can tell me what am I missing here?
> >
> > I'm using Delphi 6, FireBird 1.5 RC7, IBO 4.3A, Win2k.
> >
> > Thanks
> > Alfred
> >
> Hi there. Could you give the complete setup of your master - child?

I've already stated how both the IB_Query are being linked, what
setup are you referring to?

> does your child ib_query.ib_transaction set to dmmain.transaction?

As mentioned above, both the IB_Query.IB_Transaction are set to
DMMain.TransactionMain.

> Did you have child.post before the dmmain.transaction.commit?

No I didnt. But I don't think it would work even if I put it in.
After I add/edit an address, I did move the current record up or down
the IB_Grid, thus it must have been posted before I click the Ok
button.

> James

One question is, why does it work when I'm using IB_TransactionBar?
What is being done when the commit button is clicked? Isn't it a
simple "transaction.commit"?