Subject | Multi-user problem |
---|---|
Author | John Hart |
Post date | 2004-10-08T02:46:11Z |
Hi,
I wrote a maintenance program, started it twice and edited the same row. The
first update changed the row, the second update did not raise an exception
and therefore overwrote the first changes. I added a breakpoint on the
except' code to prove it was not called.
I have attached a copy of the properties set and a small amount of code.
Please help.
John Hart
----------
The properties of TIBODatabase are set to
DefaultTransaction.AutoCommit = true
DefaultTransaction.Isolation = tiCommitted
DefaultTransaction.LockWait = false
DefaultTransaction.RecVersion = True
DefaultTransaction.ServerAutoCommit = False
The properties of TIBOQuery are set to
CommitAction = caInvalidateCursor ( I tried caRefresh)
PessimisticLocking = false
ReadOnly = false
RecordLive = true
I have tried all combinations of the above and have spent over 20 hours on this problem.
I have tried PessimisticLocking and LockWait = true and it works as expected.
Part of Start Edit routine
if not EmptyTable(adm.tCustomer) then // if empty displays message
try
adm.tCustomer.refresh; // get latest copy
adm.tCustomer.Edit;
edbCustId.SetFocus;
except
messagedlg('Customer database error', mtError, [mbOk], 0);
end;
Part of Post routine
repeat
try
bOK := true;
adm.tCustomer.Post;
except
bOK := false;
ReplaceFields(tCustomer); // replace changed fields
end;
until bOk;
[Non-text portions of this message have been removed]
I wrote a maintenance program, started it twice and edited the same row. The
first update changed the row, the second update did not raise an exception
and therefore overwrote the first changes. I added a breakpoint on the
except' code to prove it was not called.
I have attached a copy of the properties set and a small amount of code.
Please help.
John Hart
----------
The properties of TIBODatabase are set to
DefaultTransaction.AutoCommit = true
DefaultTransaction.Isolation = tiCommitted
DefaultTransaction.LockWait = false
DefaultTransaction.RecVersion = True
DefaultTransaction.ServerAutoCommit = False
The properties of TIBOQuery are set to
CommitAction = caInvalidateCursor ( I tried caRefresh)
PessimisticLocking = false
ReadOnly = false
RecordLive = true
I have tried all combinations of the above and have spent over 20 hours on this problem.
I have tried PessimisticLocking and LockWait = true and it works as expected.
Part of Start Edit routine
if not EmptyTable(adm.tCustomer) then // if empty displays message
try
adm.tCustomer.refresh; // get latest copy
adm.tCustomer.Edit;
edbCustId.SetFocus;
except
messagedlg('Customer database error', mtError, [mbOk], 0);
end;
Part of Post routine
repeat
try
bOK := true;
adm.tCustomer.Post;
except
bOK := false;
ReplaceFields(tCustomer); // replace changed fields
end;
until bOk;
[Non-text portions of this message have been removed]