Google Cloud Spanner v1 API - Enum TransactionOptions.Types.ReadWrite.Types.ReadLockMode (5.13.0-beta04)

public enum TransactionOptions.Types.ReadWrite.Types.ReadLockMode

Reference documentation and code samples for the Google Cloud Spanner v1 API enum TransactionOptions.Types.ReadWrite.Types.ReadLockMode.

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

Namespace

Google.Cloud.Spanner.V1

Assembly

Google.Cloud.Spanner.V1.dll

Fields

Name Description
Optimistic

Optimistic lock mode.

Lock acquisition behavior depends on the isolation level in use. In both [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] and [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.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.

Pessimistic

Pessimistic lock mode.

Lock acquisition behavior depends on the isolation level in use. In [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE] isolation, reads and writes acquire necessary locks during transaction statement execution. In [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.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.

Unspecified

Default value.

  • If isolation level is [SERIALIZABLE][google.spanner.v1.TransactionOptions.IsolationLevel.SERIALIZABLE], locking semantics default to PESSIMISTIC.
  • If isolation level is [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ], locking semantics default to OPTIMISTIC.
  • See Concurrency control for more details.