Optional. The amount of latency this request is willing to incur in order
to improve throughput. If this field is not set, Spanner assumes requests
are relatively latency sensitive and automatically determines an
appropriate delay time. You can specify a batching delay value between 0
and 500 ms.
public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }
Optional. If the read-write transaction was executed on a multiplexed
session, the precommit token with the highest sequence number received in
this transaction attempt, should be included here. Failing to do so will
result in a FailedPrecondition error.
This feature is not yet supported and will result in an UNIMPLEMENTED
error.
If true, then statistics related to the transaction will be included in
the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats].
Default value is false.
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 is 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCommitRequest\u003c/code\u003e class is used to commit transactions in the Google Cloud Spanner v1 API, allowing for the execution of mutations.\u003c/p\u003e\n"],["\u003cp\u003eThis class supports both committing previously-started transactions and executing mutations in a temporary transaction, although the latter is non-idempotent.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCommitRequest\u003c/code\u003e allows setting various options, such as \u003ccode\u003eMaxCommitDelay\u003c/code\u003e, \u003ccode\u003eReturnCommitStats\u003c/code\u003e, and \u003ccode\u003eRequestOptions\u003c/code\u003e, to customize the commit behavior.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eCommitRequest\u003c/code\u003e is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e and there is a large history of different versions for this class, going as far back as \u003ccode\u003e3.5.0\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e and inherits from object, providing a robust set of features for interacting with Google Cloud Spanner.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class CommitRequest (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.CommitRequest)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.CommitRequest) \n\n public sealed class CommitRequest : IMessage\u003cCommitRequest\u003e, IEquatable\u003cCommitRequest\u003e, IDeepCloneable\u003cCommitRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class CommitRequest.\n\nThe request for \\[Commit\\]\\[google.spanner.v1.Spanner.Commit\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CommitRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CommitRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CommitRequest](/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](/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) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.V1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.V1.dll\n\nConstructors\n------------\n\n### CommitRequest()\n\n public CommitRequest()\n\n### CommitRequest(CommitRequest)\n\n public CommitRequest(CommitRequest other)\n\nProperties\n----------\n\n### HasTransactionId\n\n public bool HasTransactionId { get; }\n\nGets whether the \"transaction_id\" field is set\n\n### MaxCommitDelay\n\n public Duration MaxCommitDelay { get; set; }\n\nOptional. The amount of latency this request is willing to incur in order\nto improve throughput. If this field is not set, Spanner assumes requests\nare relatively latency sensitive and automatically determines an\nappropriate delay time. You can specify a batching delay value between 0\nand 500 ms.\n\n### Mutations\n\n public RepeatedField\u003cMutation\u003e Mutations { get; }\n\nThe mutations to be executed when this transaction commits. All\nmutations are applied atomically, in the order they appear in\nthis list.\n\n### PrecommitToken\n\n public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }\n\nOptional. If the read-write transaction was executed on a multiplexed\nsession, the precommit token with the highest sequence number received in\nthis transaction attempt, should be included here. Failing to do so will\nresult in a FailedPrecondition error.\nThis feature is not yet supported and will result in an UNIMPLEMENTED\nerror.\n\n### RequestOptions\n\n public RequestOptions RequestOptions { get; set; }\n\nCommon options for this request.\n\n### ReturnCommitStats\n\n public bool ReturnCommitStats { get; set; }\n\nIf `true`, then statistics related to the transaction will be included in\nthe \\[CommitResponse\\]\\[google.spanner.v1.CommitResponse.commit_stats\\].\nDefault value is `false`.\n\n### Session\n\n public string Session { get; set; }\n\nRequired. The session in which the transaction to be committed is running.\n\n### SessionAsSessionName\n\n public SessionName SessionAsSessionName { get; set; }\n\n[SessionName](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionName)-typed view over the [Session](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.CommitRequest#Google_Cloud_Spanner_V1_CommitRequest_Session) resource name property.\n\n### SingleUseTransaction\n\n public TransactionOptions SingleUseTransaction { get; set; }\n\nExecute mutations in a temporary transaction. Note that unlike\ncommit of a previously-started transaction, commit with a\ntemporary transaction is non-idempotent. That is, if the\n`CommitRequest` is sent to Cloud Spanner more than once (for\ninstance, due to retries in the application, or in the\ntransport library), it is possible that the mutations are\nexecuted more than once. If this is undesirable, use\n\\[BeginTransaction\\]\\[google.spanner.v1.Spanner.BeginTransaction\\] and\n\\[Commit\\]\\[google.spanner.v1.Spanner.Commit\\] instead.\n\n### TransactionCase\n\n public CommitRequest.TransactionOneofCase TransactionCase { get; }\n\n### TransactionId\n\n public ByteString TransactionId { get; set; }\n\nCommit a previously-started transaction."]]