# Google Cloud Spanner v1 API - Class TransactionOptions (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 sealed class TransactionOptions : IMessage<TransactionOptions>, IEquatable<TransactionOptions>, IDeepCloneable<TransactionOptions>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Spanner v1 API class TransactionOptions.

Options to use for transactions.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> TransactionOptions

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TransactionOptions](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TransactionOptions](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TransactionOptions](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## 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

## Constructors

### TransactionOptions()

    public TransactionOptions()

### TransactionOptions(TransactionOptions)

    public TransactionOptions(TransactionOptions other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions` |

## Properties

### ExcludeTxnFromChangeStreams

    public bool ExcludeTxnFromChangeStreams { get; set; }

When `exclude_txn_from_change_streams` is set to `true`, it prevents read
or write transactions from being tracked in change streams.

- If the DDL option `allow_txn_exclusion` is set to `true`, then the
  updates
  made within this transaction aren't recorded in the change stream.

- If you don't set the DDL option `allow_txn_exclusion` or if it's
  set to `false`, then the updates made within this transaction are
  recorded in the change stream.

When `exclude_txn_from_change_streams` is set to `false` or not set,
modifications from this transaction are recorded in all change streams
that are tracking columns modified by these transactions.

The `exclude_txn_from_change_streams` option can only be specified
for read-write or partitioned DML transactions, otherwise the API returns
an `INVALID_ARGUMENT` error.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### IsolationLevel

    public TransactionOptions.Types.IsolationLevel IsolationLevel { get; set; }

Isolation level for the transaction.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Types.IsolationLevel` |   |

### ModeCase

    public TransactionOptions.ModeOneofCase ModeCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.ModeOneofCase` |   |

### PartitionedDml

    public TransactionOptions.Types.PartitionedDml PartitionedDml { get; set; }

Partitioned DML transaction.

Authorization to begin a Partitioned DML transaction requires
`spanner.databases.beginPartitionedDmlTransaction` permission
on the `session` resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Types.PartitionedDml` |   |

### ReadOnly

    public TransactionOptions.Types.ReadOnly ReadOnly { get; set; }

Transaction does not write.

Authorization to begin a read-only transaction requires
`spanner.databases.beginReadOnlyTransaction` permission
on the `session` resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Types.ReadOnly` |   |

### ReadWrite

    public TransactionOptions.Types.ReadWrite ReadWrite { get; set; }

Transaction may write.

Authorization to begin a read-write transaction requires
`spanner.databases.beginOrRollbackReadWriteTransaction` permission
on the `session` resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions.Types.ReadWrite` |   |