Reference documentation and code samples for the Cloud Spanner V1 Client class ReadLockMode.
ReadLockMode is used to set the read lock mode for read-write
transactions.
Protobuf type google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode
Namespace
Google \ Cloud \ Spanner \ V1 \ TransactionOptions \ ReadWriteMethods
static::name
| Parameter | |
|---|---|
| Name | Description |
value |
mixed
|
static::value
| Parameter | |
|---|---|
| Name | Description |
name |
mixed
|
Constants
READ_LOCK_MODE_UNSPECIFIED
Value: 0Default 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.
Generated from protobuf enum READ_LOCK_MODE_UNSPECIFIED = 0;
PESSIMISTIC
Value: 1Pessimistic 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.
Generated from protobuf enum PESSIMISTIC = 1;
OPTIMISTIC
Value: 2Optimistic 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.
Generated from protobuf enum OPTIMISTIC = 2;