id may be used to identify the transaction in subsequent
[Read][google.spanner.v1.Spanner.Read],
[ExecuteSql][google.spanner.v1.Spanner.ExecuteSql],
[Commit][google.spanner.v1.Spanner.Commit], or
[Rollback][google.spanner.v1.Spanner.Rollback] calls.
Single-use read-only transactions do not have IDs, because
single-use transactions do not support multiple requests.
public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }
A precommit token will be included in the response of a BeginTransaction
request if the read-write transaction is on a multiplexed session and
a mutation_key was specified in the
[BeginTransaction][google.spanner.v1.BeginTransactionRequest].
The precommit token with the highest sequence number from this transaction
attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit]
request for this transaction.
This feature is not yet supported and will result in an UNIMPLEMENTED
error.
For snapshot read-only transactions, the read timestamp chosen
for the transaction. Not returned by default: see
[TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp].
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example: "2014-10-02T15:01:23.045123456Z".
[[["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 latest version of the Google Cloud Spanner v1 API class Transaction is 5.0.0-beta05, with multiple previous versions available, including beta and stable releases.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTransaction\u003c/code\u003e class is a core component of the Google Cloud Spanner v1 API, serving as a representation of a transaction, implementing interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, and \u003ccode\u003eIDeepCloneable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eTransaction\u003c/code\u003e object has properties like \u003ccode\u003eId\u003c/code\u003e, \u003ccode\u003ePrecommitToken\u003c/code\u003e, and \u003ccode\u003eReadTimestamp\u003c/code\u003e, which provide key data related to the state and management of the transaction.\u003c/p\u003e\n"],["\u003cp\u003eTransactions can have an \u003ccode\u003eId\u003c/code\u003e to be identified in subsequent Read, ExecuteSql, Commit, or Rollback calls, though single-use read-only transactions do not have them.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePrecommitToken\u003c/code\u003e property is related to multiplexed sessions and is used in the Commit process for read-write transactions, although this feature is currently unsupported.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class Transaction (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.Transaction)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.Transaction)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.Transaction)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.Transaction)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.Transaction)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.Transaction)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.Transaction)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.Transaction)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.Transaction)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.Transaction)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.Transaction) \n\n public sealed class Transaction : IMessage\u003cTransaction\u003e, IEquatable\u003cTransaction\u003e, IDeepCloneable\u003cTransaction\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class Transaction.\n\nA transaction. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Transaction \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Transaction](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Transaction), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Transaction](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Transaction), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Transaction](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.Transaction), [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### Transaction()\n\n public Transaction()\n\n### Transaction(Transaction)\n\n public Transaction(Transaction other)\n\nProperties\n----------\n\n### Id\n\n public ByteString Id { get; set; }\n\n`id` may be used to identify the transaction in subsequent\n\\[Read\\]\\[google.spanner.v1.Spanner.Read\\],\n\\[ExecuteSql\\]\\[google.spanner.v1.Spanner.ExecuteSql\\],\n\\[Commit\\]\\[google.spanner.v1.Spanner.Commit\\], or\n\\[Rollback\\]\\[google.spanner.v1.Spanner.Rollback\\] calls.\n\nSingle-use read-only transactions do not have IDs, because\nsingle-use transactions do not support multiple requests.\n\n### PrecommitToken\n\n public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }\n\nA precommit token will be included in the response of a BeginTransaction\nrequest if the read-write transaction is on a multiplexed session and\na mutation_key was specified in the\n\\[BeginTransaction\\]\\[google.spanner.v1.BeginTransactionRequest\\].\nThe precommit token with the highest sequence number from this transaction\nattempt should be passed to the \\[Commit\\]\\[google.spanner.v1.Spanner.Commit\\]\nrequest for this transaction.\nThis feature is not yet supported and will result in an UNIMPLEMENTED\nerror.\n\n### ReadTimestamp\n\n public Timestamp ReadTimestamp { get; set; }\n\nFor snapshot read-only transactions, the read timestamp chosen\nfor the transaction. Not returned by default: see\n\\[TransactionOptions.ReadOnly.return_read_timestamp\\]\\[google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp\\].\n\nA timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`."]]