Hello Paul,
We reviewed that once again + your setting in TADConnection and TADTable components.
The way it's configured now the application works as designed.
Your connection has the pessimistic (
more) locking mode:
| Code: |
object AnyConnection1: TADConnection
UpdateOptions.LockMode = lmPessimistic
UpdateOptions.LockPoint = lpImmediate
UpdateOptions.LockWait = True
|
That will in turn mean that for ADTable2 on Edit method call the record will be locked and a transaction started.
On Cancel the transaction will be rolled back.
Your options in this case could be:
- wrapping all code into explicit StartTransaction / Commit calls:
| Code: |
AnyConnection1.StartTransaction;
ADTable2.Edit;
ADTable1.Insert;
ADTable1.Post;
ADTable2.Cancel;
AnyConnection1.Commit;
|
- not using pessimistic locking for AnyConnection1
- not using pessimistic locking for ADTable2 (setting its UpdateOptions will override connection ones)
Please let us know if this helped.