Page 1 of 1

LockMode and Optimistic Locking

Posted: Wed 03 May 2017 14:46
by JoaoMarcos
I'm going to use optimistic locking for my application, and I set TSmartQuery.LockMode to lmLockDelayed
and CheckMode to cmException (as suggested in the documentation). Also I set RefreshOptions to [roBeforeEdit].

My question is, if there's any conflict (a user is posting to database a record that was just changed by another user) what will ODAC do?
Is there something I need to check or do if this ever happens?

Tks

Re: LockMode and Optimistic Locking

Posted: Thu 11 May 2017 09:27
by MaximG
To check whether the current record was changed by another user, in your case use the [roAfterUpdate] value of the RefreshOptions property.