I use pessimitic locking since a long time with your components and Firebird. I never had problems in the past. But recently with version 2.5.3 in sometimes I have some records remaining locked (after a batch update with a lot of records retrieval, udpates and appends).
I want to move to optimistic locking as this is the advised solution.
I tested it with but the changes of user 1 are overwritten by the changes of a second user without error.
I have a Query component with a transaction component.
In the query component I have ImLockDelayed in the lock mode.
In the transaction I refer to a transaction component with IblReadOnlyReadCommitted and in the UpdateTransaction I refer to a transaction component with IblReadCommitted.
I use twice the program and updating a record in the 2 programs. The changes made by the first user are overwritten by the second user.
Can you help me ?
Thanks for your response.
Max.
Optimistic locking
Re: Optimistic locking
Please describe the problem in more details. The described behavior of TIBCQuery is correct. If the TIBCQuery.LockMode property is set to lmLockDelayed, the record will be locked just before calling the Post method. Therefore the data changes of the application, that was the last to call the TIBCQuery.Post method, will be saved on the server.