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.
All reads performed during the transaction observe a consistent snapshot
of the database, and the transaction is only successfully committed 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Cloud Spanner V1 Client - Class IsolationLevel (1.104.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.104.0 (latest)](/php/docs/reference/cloud-spanner/latest/V1.TransactionOptions.IsolationLevel)\n- [1.103.0](/php/docs/reference/cloud-spanner/1.103.0/V1.TransactionOptions.IsolationLevel)\n- [1.102.0](/php/docs/reference/cloud-spanner/1.102.0/V1.TransactionOptions.IsolationLevel)\n- [1.101.0](/php/docs/reference/cloud-spanner/1.101.0/V1.TransactionOptions.IsolationLevel)\n- [1.100.0](/php/docs/reference/cloud-spanner/1.100.0/V1.TransactionOptions.IsolationLevel)\n- [1.98.0](/php/docs/reference/cloud-spanner/1.98.0/V1.TransactionOptions.IsolationLevel)\n- [1.97.0](/php/docs/reference/cloud-spanner/1.97.0/V1.TransactionOptions.IsolationLevel)\n- [1.96.0](/php/docs/reference/cloud-spanner/1.96.0/V1.TransactionOptions.IsolationLevel)\n- [1.95.0](/php/docs/reference/cloud-spanner/1.95.0/V1.TransactionOptions.IsolationLevel)\n- [1.94.0](/php/docs/reference/cloud-spanner/1.94.0/V1.TransactionOptions.IsolationLevel)\n- [1.93.1](/php/docs/reference/cloud-spanner/1.93.1/V1.TransactionOptions.IsolationLevel)\n- [1.92.1](/php/docs/reference/cloud-spanner/1.92.1/V1.TransactionOptions.IsolationLevel)\n- [1.91.0](/php/docs/reference/cloud-spanner/1.91.0/V1.TransactionOptions.IsolationLevel)\n- [1.90.0](/php/docs/reference/cloud-spanner/1.90.0/V1.TransactionOptions.IsolationLevel)\n- [1.89.0](/php/docs/reference/cloud-spanner/1.89.0/V1.TransactionOptions.IsolationLevel)\n- [1.88.0](/php/docs/reference/cloud-spanner/1.88.0/V1.TransactionOptions.IsolationLevel)\n- [1.87.0](/php/docs/reference/cloud-spanner/1.87.0/V1.TransactionOptions.IsolationLevel)\n- [1.86.0](/php/docs/reference/cloud-spanner/1.86.0/V1.TransactionOptions.IsolationLevel)\n- [1.85.0](/php/docs/reference/cloud-spanner/1.85.0/V1.TransactionOptions.IsolationLevel)\n- [1.84.0](/php/docs/reference/cloud-spanner/1.84.0/V1.TransactionOptions.IsolationLevel)\n- [1.83.0](/php/docs/reference/cloud-spanner/1.83.0/V1.TransactionOptions.IsolationLevel)\n- [1.82.0](/php/docs/reference/cloud-spanner/1.82.0/V1.TransactionOptions.IsolationLevel)\n- [1.81.0](/php/docs/reference/cloud-spanner/1.81.0/V1.TransactionOptions.IsolationLevel)\n- [1.80.0](/php/docs/reference/cloud-spanner/1.80.0/V1.TransactionOptions.IsolationLevel)\n- [1.79.0](/php/docs/reference/cloud-spanner/1.79.0/V1.TransactionOptions.IsolationLevel)\n- [1.78.0](/php/docs/reference/cloud-spanner/1.78.0/V1.TransactionOptions.IsolationLevel)\n- [1.77.0](/php/docs/reference/cloud-spanner/1.77.0/V1.TransactionOptions.IsolationLevel)\n- [1.76.1](/php/docs/reference/cloud-spanner/1.76.1/V1.TransactionOptions.IsolationLevel)\n- [1.68.0](/php/docs/reference/cloud-spanner/1.68.0/V1.TransactionOptions.IsolationLevel)\n- [1.67.0](/php/docs/reference/cloud-spanner/1.67.0/V1.TransactionOptions.IsolationLevel)\n- [1.66.0](/php/docs/reference/cloud-spanner/1.66.0/V1.TransactionOptions.IsolationLevel)\n- [1.65.0](/php/docs/reference/cloud-spanner/1.65.0/V1.TransactionOptions.IsolationLevel)\n- [1.64.0](/php/docs/reference/cloud-spanner/1.64.0/V1.TransactionOptions.IsolationLevel)\n- [1.63.2](/php/docs/reference/cloud-spanner/1.63.2/V1.TransactionOptions.IsolationLevel)\n- [1.62.1](/php/docs/reference/cloud-spanner/1.62.1/V1.TransactionOptions.IsolationLevel)\n- [1.61.0](/php/docs/reference/cloud-spanner/1.61.0/V1.TransactionOptions.IsolationLevel)\n- [1.60.0](/php/docs/reference/cloud-spanner/1.60.0/V1.TransactionOptions.IsolationLevel)\n- [1.59.0](/php/docs/reference/cloud-spanner/1.59.0/V1.TransactionOptions.IsolationLevel)\n- [1.58.4](/php/docs/reference/cloud-spanner/1.58.4/V1.TransactionOptions.IsolationLevel)\n- [1.57.0](/php/docs/reference/cloud-spanner/1.57.0/V1.TransactionOptions.IsolationLevel)\n- [1.56.0](/php/docs/reference/cloud-spanner/1.56.0/V1.TransactionOptions.IsolationLevel)\n- [1.55.0](/php/docs/reference/cloud-spanner/1.55.0/V1.TransactionOptions.IsolationLevel)\n- [1.54.2](/php/docs/reference/cloud-spanner/1.54.2/V1.TransactionOptions.IsolationLevel) \nReference documentation and code samples for the Cloud Spanner V1 Client class IsolationLevel.\n\n`IsolationLevel` is used when setting `isolation_level` for a transaction.\n\nProtobuf type `google.spanner.v1.TransactionOptions.IsolationLevel`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Spanner \\\\ V1 \\\\ TransactionOptions\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### ISOLATION_LEVEL_UNSPECIFIED\n\n Value: 0\n\nDefault value.\n\nIf the value is not specified, the `SERIALIZABLE` isolation level is\nused.\n\nGenerated from protobuf enum `ISOLATION_LEVEL_UNSPECIFIED = 0;`\n\n### SERIALIZABLE\n\n Value: 1\n\nAll transactions appear as if they executed in a serial order, even if\nsome of the reads, writes, and other operations of distinct transactions\nactually occurred in parallel. Spanner assigns commit timestamps that\nreflect the order of committed transactions to implement this property.\n\nSpanner offers a stronger guarantee than serializability called external\nconsistency. For further details, please refer to\n\u003chttps://cloud.google.com/spanner/docs/true-time-external-consistency#serializability\u003e.\n\nGenerated from protobuf enum `SERIALIZABLE = 1;`\n\n### REPEATABLE_READ\n\n Value: 2\n\nAll reads performed during the transaction observe a consistent snapshot\nof the database, and the transaction is only successfully committed in\nthe absence of conflicts between its updates and any concurrent updates\nthat have occurred since that snapshot. Consequently, in contrast to\n`SERIALIZABLE` transactions, only write-write conflicts are detected in\nsnapshot transactions.\n\nThis isolation level does not support Read-only and Partitioned DML\ntransactions.\nWhen `REPEATABLE_READ` is specified on a read-write transaction, the\nlocking semantics default to `OPTIMISTIC`.\n\nGenerated from protobuf enum `REPEATABLE_READ = 2;`"]]