TMedTable.LockingMode TMedTable

property LockingMode: TMedLockingMode ;

Description

Use this property to set desired locking mode for the table. There are three possible settings of LockingMode property:

·rlmDefault - the default setting. The actual locking method is determined at the moment of dataset activation by using TMedConnection.LockinMode property value.

·rlmPessimistic - selects pessimistic locking medhod. In this method record lock is placed at the moment when TMedTable.Edit method is executed and released when you call TMedTable.Post method. Calling Edit method refreshes the record buffer content to ensure it accurately reflects the actual content of the locked record. This method ensures nobody will modify record after you call Edit and before you call Post.

·rlmOptimistic - selects optimistic locking medhod. In this method record lock is placed at the moment when TMedTable.Post method is executed and released immediately after updating record. Edit method neither places the lock nor refreshes the record buffer with the fresh content. This method ensures the shortest possible time of holding record but the record can be modified by other users after it was originally fetched and before the Post. This means the record you update with Post method may hold different values than it had at the moment it was fetched. This is especially dangerous if you modify record on the basis of its old values. If you require full content synchronization between database record and your application record buffer - choose rlmPessimistic locking method.