During a lock conversion operation,
the lock mode held by the application waiting to acquire the lock,
before the conversion is completed.
Table 2. Snapshot Monitoring InformationSnapshot Level |
Logical Data Grouping |
Monitor Switch |
Lock |
lock |
Basic |
Lock |
lock_wait |
Basic |
Table 3. Event Monitoring InformationEvent Type |
Logical Data Grouping |
Monitor Switch |
Locking |
- |
- |
Deadlocks1 |
lock |
- |
Deadlocks1 |
event_dlconn |
- |
- 1
- This option has been deprecated. Its
use is no longer recommended and might be removed in a future release.
Use the CREATE EVENT MONITOR FOR LOCKING statement to monitor lock-related
events, such as lock timeouts, lock waits, and deadlocks.
Usage
The following scenario describes an
example of lock conversion. During an update or delete operation it
is possible to wait for an X lock on the target row. If the transaction
is holding an S or V lock on the row, this would require a conversion.
At this point, the lock_current_mode element
is assigned a value of S or V, while the lock waits to be converted
to an X lock.
The possible lock modes
are listed in the following table.
Mode |
Type of Lock |
API Constant |
|
No Lock |
SQLM_LNON |
IS |
Intention Share Lock |
SQLM_LOIS |
IX |
Intention Exclusive Lock |
SQLM_LOIX |
S |
Share Lock |
SQLM_LOOS |
SIX |
Share with Intention Exclusive Lock |
SQLM_LSIX |
X |
Exclusive Lock |
SQLM_LOOX |
IN |
Intent None |
SQLM_LOIN |
Z |
Super Exclusive Lock |
SQLM_LOOZ |
U |
Update Lock |
SQLM_LOOU |
NS |
Scan
Share Lock |
SQLM_LONS |
NW |
Next Key Weak Exclusive Lock |
SQLM_LONW |