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

5.13.0-beta07 5.13.0-beta06 5.12.0 (latest) 5.11.0 5.10.0 5.9.0 5.8.0 5.7.0 5.6.0 5.5.0 5.4.0 5.3.0 5.2.0 5.1.0 5.0.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.15.1 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0

    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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/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](https://cloud.google.com/spanner/docs/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](https://cloud.google.com/spanner/docs/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](https://cloud.google.com/spanner/docs/concurrency-control) for more details. |