LockMode and Optimistic Locking

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
JoaoMarcos
Posts: 26
Joined: Fri 28 Jun 2013 20:26

LockMode and Optimistic Locking

Post by JoaoMarcos » Wed 03 May 2017 14:46

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

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: LockMode and Optimistic Locking

Post by MaximG » Thu 11 May 2017 09:27

To check whether the current record was changed by another user, in your case use the [roAfterUpdate] value of the RefreshOptions property.

Post Reply