Hello,
I'm trying to get the next insertion ID of the master table to put it to the detail's MasterFK field and persist both of the tables in one single commit. How can I accomplish this?
What I tried to do is something like
ZConnection options:
AutoCommit = FALSE
TransactionIsolationLevel = tiReadCommitted
ZQuery options:
CachedUpdates = TRUE
ZQuery1Field1.Value := Edit1.Text;
ZQuery1.ApplyUpdates;
ZQuery2MasterFK.Value := ZQuery1Id.Value;
ZQuery2Field1.Value := Edit2.Text;
ZQuery2.ApplyUpdates;
ZConnection1.Commit;
how to persist master-detail tables in a single transaction?
Moderators: gto, cipto_kh, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Re: how to persist master-detail tables in a single transact
This is a good question. But I don't know the solution.
When using mysql autoincrements are retrieved at post time. So I think you should at least make sure posting happens immediately when doing record navigation.
For databases where the ZSequence component is implemented it may be easier to assign the id's using the ZSequence component.
Mark
When using mysql autoincrements are retrieved at post time. So I think you should at least make sure posting happens immediately when doing record navigation.
For databases where the ZSequence component is implemented it may be easier to assign the id's using the ZSequence component.
Mark