LockStrength enumeration: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
#REDIRECT [[New (Recordset constructor)#LockStrength enumeration]]
<!-- LockingStrength enumeration -->
This enumeration is used to indicate the strength of a lock, and is often used in controlling locking for [[Record_class|Records]] and [[Recordset_class|Recordsets]].
These are the valid values of this [[Enumerations|enumeration]], which correspond to standard <var class="product">Model 204</var> record-locking levels:
<table>
<tr>
<td>None</td>
<td>Object is not locked.<br/>No locks are held on the object, so there can be no conflict with others holding <var>Share</var> or <var>Exclusive</var> locks (readers and updaters may proceed). <var>Find Without Locks</var> statements acquire this type of record lock for Recordsets.</td>
</tr>
<tr>
<td>Share</td>
<td>Object is locked in share mode.<br/>This level allows other users to hold a Share lock, but not an Exclusive lock (allows readers but not updaters to proceed). <var>Find All Records</var> statements acquire this type of record lock for Recordsets.</td>
</tr>
<tr>
<td>Exclusive</td>
<td>Object is locked in exclusive mode.<br/>This level prohibits others from holding either an <var>Exclusive</var> lock or a <var>Share</var> lock. It is generally used for update. <var>Find And Reserve</var> statements acquire this type of record lock.</td>
</tr>
</table>
'''Note:''' As with all enumerations, the <var>ToString</var> method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see [[Enumerations#Common enumeration methods|"Common enumeration methods"]].

Revision as of 12:06, 30 August 2012

This enumeration is used to indicate the strength of a lock, and is often used in controlling locking for Records and Recordsets. These are the valid values of this enumeration, which correspond to standard Model 204 record-locking levels:

None Object is not locked.
No locks are held on the object, so there can be no conflict with others holding Share or Exclusive locks (readers and updaters may proceed). Find Without Locks statements acquire this type of record lock for Recordsets.
Share Object is locked in share mode.
This level allows other users to hold a Share lock, but not an Exclusive lock (allows readers but not updaters to proceed). Find All Records statements acquire this type of record lock for Recordsets.
Exclusive Object is locked in exclusive mode.
This level prohibits others from holding either an Exclusive lock or a Share lock. It is generally used for update. Find And Reserve statements acquire this type of record lock.

Note: As with all enumerations, the ToString method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see "Common enumeration methods".