optimistic locking

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
niniramos
Posts: 11
Joined: Tue 04 Jul 2006 07:40

optimistic locking

Post by niniramos » Mon 14 Aug 2006 11:33

HOW CAN I USE THE optimistic locking IN ORACLE??

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 15 Aug 2006 08:24

TOraQuery, TSmartQuery, TOraTable components have LockMode property which can be set in lmNone or lmDelayed for optimistic locking.

niniramos
Posts: 11
Joined: Tue 04 Jul 2006 07:40

optimistic locking

Post by niniramos » Wed 16 Aug 2006 07:35

sorry i don´t understand you. you say that "lmDelayed" LockMode is for the optimistic locking???

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 16 Aug 2006 10:02

Yes, lmLockDelayed is used for optimistic locking. In that case dataset executes SELECT FOR UPDATE NO WAIT query just before posting changes to be sure that the record is not locked.
Also you should set CheckMode property to cmException. In that case the dataset checks if the record wasn't changed by another user, otherwise it generates an exception.

niniramos
Posts: 11
Joined: Tue 04 Jul 2006 07:40

Post by niniramos » Wed 16 Aug 2006 12:01

OK THANKS, NOW IS PERFECT!!!! :D

Post Reply