Enum TransactionOptions.ReadWrite.ReadLockMode (6.116.0)

public enum TransactionOptions.ReadWrite.ReadLockMode extends Enum<TransactionOptions.ReadWrite.ReadLockMode> implements ProtocolMessageEnum

ReadLockMode is used to set the read lock mode for read-write transactions.

Protobuf enum google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode

Implements

ProtocolMessageEnum

Static Fields

Name Description
OPTIMISTIC

Optimistic lock mode.

Lock acquisition behavior depends on the isolation level in use. In both SERIALIZABLE and REPEATABLE_READ isolation, reads and writes do not acquire locks during transaction statement execution. See Concurrency control for details on how the guarantees of each isolation level are provided at commit time.

OPTIMISTIC = 2;

OPTIMISTIC_VALUE

Optimistic lock mode.

Lock acquisition behavior depends on the isolation level in use. In both SERIALIZABLE and REPEATABLE_READ isolation, reads and writes do not acquire locks during transaction statement execution. See Concurrency control for details on how the guarantees of each isolation level are provided at commit time.

OPTIMISTIC = 2;

PESSIMISTIC

Pessimistic lock mode.

Lock acquisition behavior depends on the isolation level in use. In SERIALIZABLE isolation, reads and writes acquire necessary locks during transaction statement execution. In REPEATABLE_READ isolation, reads that explicitly request to be locked and writes acquire locks. See Concurrency control for details on the types of locks acquired at each transaction step.

PESSIMISTIC = 1;

PESSIMISTIC_VALUE

Pessimistic lock mode.

Lock acquisition behavior depends on the isolation level in use. In SERIALIZABLE isolation, reads and writes acquire necessary locks during transaction statement execution. In REPEATABLE_READ isolation, reads that explicitly request to be locked and writes acquire locks. See Concurrency control for details on the types of locks acquired at each transaction step.

PESSIMISTIC = 1;

READ_LOCK_MODE_UNSPECIFIED

Default value.

  • If isolation level is SERIALIZABLE, locking semantics default to PESSIMISTIC.
  • If isolation level is REPEATABLE_READ, locking semantics default to OPTIMISTIC.
  • See Concurrency control for more details.

READ_LOCK_MODE_UNSPECIFIED = 0;

READ_LOCK_MODE_UNSPECIFIED_VALUE

Default value.

  • If isolation level is SERIALIZABLE, locking semantics default to PESSIMISTIC.
  • If isolation level is REPEATABLE_READ, locking semantics default to OPTIMISTIC.
  • See Concurrency control for more details.

READ_LOCK_MODE_UNSPECIFIED = 0;

UNRECOGNIZED

Static Methods

Name Description
forNumber(int value)
getDescriptor()
internalGetValueMap()
valueOf(Descriptors.EnumValueDescriptor desc)
valueOf(int value)

Deprecated. Use #forNumber(int) instead.

valueOf(String name)
values()

Methods

Name Description
getDescriptorForType()
getNumber()
getValueDescriptor()