Board index » delphi » Master/Detail - Delphi & IB

Master/Detail - Delphi & IB

Can anyone help ?

I have a problem using master/detail and explicit transaction as
follows:

Start transaction:

Insert record into master and post;

Insert record into detail, on post I get an error that the master record
is missing.

Is this saying that I have to commit the master first, if so how can I
create a "commit unit" in a master detail scenario ? Is there anyway I
can ensure Referential Integrity without using cached updates ?

I seem to remember doing the following many years ago with oracle:

Start Transaction;

Insert Master and Post;

Insert Details and Post;

Then prompt the user 'Do you wish to commit transactions ?
Yes, then commit;
No, then rollback;

Or Yes, encounter an exception so rollback

Is this scenario supported with IB & Delphi ?, it seems a very simple
requirement !!!!!

Many thanks.

Andy.

 

Re:Master/Detail - Delphi & IB


:

Quote
>Insert record into master and post;

>Insert record into detail, on post I get an error that the master record
>is missing.

>Is this saying that I have to commit the master first,

Yes

Quote
> if so how can I
>create a "commit unit" in a master detail scenario ? Is there anyway I
>can ensure Referential Integrity without using cached updates ?

I am not sure what you are asking here but you can not have referential
integrity link between detail and master and have both the detail and the master
in the same transaction or in cached updates.

Remove the referential integrity or the cached updates

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads