Mixin: Locking

Locking

Locking mixin.

Members


<static, readonly> LockContention :number

Enum to identify row locking modes.
Type:
  • number
Example
LockContention.DEFAULT
LockContention.NOWAIT
LockContention.SKIP_LOCKED

Methods


lockExclusive( [mode])

Use an exclusive lock for the query.
Parameters:
Name Type Argument Description
mode LockContention <optional>
row locking mode
Returns:
The query instance.
Type
Locking
Example
collection.find().lockExclusive();
collection.find().lockExclusive(mysqlx.LockContention.NOWAIT)
collection.find().lockExclusive(mysqlx.LockContention.SKIP_LOCKED)

lockShared( [mode])

Use a shared lock for the query.
Parameters:
Name Type Argument Description
mode LockContention <optional>
row locking mode
Returns:
The query instance.
Type
Locking
Example
collection.find().lockShared();
collection.find().lockShared(mysqlx.LockContention.NOWAIT)
collection.find().lockShared(mysqlx.LockContention.SKIP_LOCKED)