Cloud Spanner V1 Client - Class IsolationLevel (1.95.0)

Reference documentation and code samples for the Cloud Spanner V1 Client class IsolationLevel.

IsolationLevel is used when setting isolation_level for a transaction.

Protobuf type google.spanner.v1.TransactionOptions.IsolationLevel

Namespace

Google \ Cloud \ Spanner \ V1 \ TransactionOptions

Methods

static::name

Parameter
Name Description
value mixed

static::value

Parameter
Name Description
name mixed

Constants

ISOLATION_LEVEL_UNSPECIFIED

Value: 0

Default value.

If the value is not specified, the SERIALIZABLE isolation level is used.

Generated from protobuf enum ISOLATION_LEVEL_UNSPECIFIED = 0;

SERIALIZABLE

Value: 1

All transactions appear as if they executed in a serial order, even if some of the reads, writes, and other operations of distinct transactions actually occurred in parallel. Spanner assigns commit timestamps that reflect the order of committed transactions to implement this property.

Spanner offers a stronger guarantee than serializability called external consistency. For further details, please refer to https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability.

Generated from protobuf enum SERIALIZABLE = 1;

REPEATABLE_READ

Value: 2

All reads performed during the transaction observe a consistent snapshot of the database, and the transaction will only successfully commit in the absence of conflicts between its updates and any concurrent updates that have occurred since that snapshot. Consequently, in contrast to SERIALIZABLE transactions, only write-write conflicts are detected in snapshot transactions.

This isolation level does not support Read-only and Partitioned DML transactions. When REPEATABLE_READ is specified on a read-write transaction, the locking semantics default to OPTIMISTIC.

Generated from protobuf enum REPEATABLE_READ = 2;