MDAC 2.5 SDK - OLE DB Programmer's Reference
Appendix C: OLE DB Properties
DBPROP_LOCKMODE
Property group: Rowset
Property set: DBPROPSET_ROWSET
Column? N
Type: VT_I4
Typical R/W: R/W
Description: Lock Mode
Indicates the level of locking performed by the rowset. One of the following:
- DBPROPVAL_LM_NONE—The provider is not required to lock rows at any time to ensure successful updates. Updates may fail when sent to the server for reasons of concurrency (for example, if someone else has updated the row).
- DBPROPVAL_LM_SINGLEROW—The provider uses the minimum level of locking necessary to ensure that changes successfully written to a single row returned by the most recent fetch will not fail due to a concurrency violation. Therefore, when using deferred update mode, IRowsetUpdate::Update will not fail due to a concurrency violation. This may mean that the provider takes a lock on the row when IRowsetChange::SetData is first called on the row, but the provider may lock the row as early as when it is read in order to guarantee that operations on the row, such as updates, will succeed. The implications of DBPROPVAL_LM_SINGLEROW, and DBPROP_LOCKMODE in general, are the same in both immediate and deferred update modes.
Lock Mode and Isolation Level are closely related but distinct. A consumer's isolation level specifies the isolation of that consumer from changes made by other users to the underlying data. Lock mode defines when underlying data is locked to ensure that updates succeed. The provider may use locking to enforce higher levels of isolation, in which case a higher level of locking may occur than is required to enforce the specified lock mode. Lock mode specifies the minimum level of locking.