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

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

The request for \[Commit\]\[google.spanner.v1.Spanner.Commit\].

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CommitRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CommitRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CommitRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest), [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

### CommitRequest()

    public CommitRequest()

### CommitRequest(CommitRequest)

    public CommitRequest(CommitRequest other)

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

## Properties

### HasTransactionId

    public bool HasTransactionId { get; }

Gets whether the "transaction_id" field is set

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

### MaxCommitDelay

    public Duration MaxCommitDelay { get; set; }

Optional. The amount of latency this request is configured to incur in
order to improve throughput. If this field isn't set, Spanner assumes
requests are relatively latency sensitive and automatically determines an
appropriate delay time. You can specify a commit delay value between 0 and
500 ms.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Duration.html` |   |

### Mutations

    public RepeatedField<Mutation> Mutations { get; }

The mutations to be executed when this transaction commits. All
mutations are applied atomically, in the order they appear in
this list.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Mutation` |   |

### PrecommitToken

    public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }

Optional. If the read-write transaction was executed on a multiplexed
session, then you must include the precommit token with the highest
sequence number received in this transaction attempt. Failing to do so
results in a `FailedPrecondition` error.

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

### RequestOptions

    public RequestOptions RequestOptions { get; set; }

Common options for this request.

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

### ReturnCommitStats

    public bool ReturnCommitStats { get; set; }

If `true`, then statistics related to the transaction is included in
the \[CommitResponse\]\[google.spanner.v1.CommitResponse.commit_stats\].
Default value is `false`.

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

### RoutingHint

    public RoutingHint RoutingHint { get; set; }

Optional. Makes the Spanner requests location-aware if present.

It gives the server hints that can be used to route the request
to an appropriate server, potentially significantly decreasing latency and
improving throughput. To achieve improved performance, most fields must be
filled in with accurate values.

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

### Session

    public string Session { get; set; }

Required. The session in which the transaction to be committed is running.

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

### SessionAsSessionName

    public SessionName SessionAsSessionName { get; set; }

[SessionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionName)-typed view over the [Session](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest#Google_Cloud_Spanner_V1_CommitRequest_Session) resource name property.

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

### SingleUseTransaction

    public TransactionOptions SingleUseTransaction { get; set; }

Execute mutations in a temporary transaction. Note that unlike
commit of a previously-started transaction, commit with a
temporary transaction is non-idempotent. That is, if the
`CommitRequest` is sent to Cloud Spanner more than once (for
instance, due to retries in the application, or in the
transport library), it's possible that the mutations are
executed more than once. If this is undesirable, use
\[BeginTransaction\]\[google.spanner.v1.Spanner.BeginTransaction\] and
\[Commit\]\[google.spanner.v1.Spanner.Commit\] instead.

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

### TransactionCase

    public CommitRequest.TransactionOneofCase TransactionCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest.TransactionOneofCase` |   |

### TransactionId

    public ByteString TransactionId { get; set; }

Commit a previously-started transaction.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` |   |