Mixin: Locking

Locking

Locking mixin.
Source:

Members

(static, constant) LockContention :LockContention

Row locking modes.
Type:
Source:

(static, constant) Type :Type

Row locking types.
Type:
  • Type
Source:

Methods

lockExclusive(modeopt) → {Locking}

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

lockShared(modeopt) → {Locking}

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