public sealed class ExecuteBatchDmlRequest : IMessage<ExecuteBatchDmlRequest>, IEquatable<ExecuteBatchDmlRequest>, IDeepCloneable<ExecuteBatchDmlRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Spanner v1 API class ExecuteBatchDmlRequest.
The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml].
Optional. If set to true, this request marks the end of the transaction.
The transaction should be committed or aborted after these statements
execute, and attempts to execute any other requests against this
transaction (including reads and queries) will be rejected.
Setting this option may cause some error reporting to be deferred until
commit time (e.g. validation of unique constraints). Given this, successful
execution of statements should not be assumed until a subsequent Commit
call completes successfully.
Required. A per-transaction sequence number used to identify this request.
This field makes each request idempotent such that if the request is
received multiple times, at most one will succeed.
The sequence number must be monotonically increasing within the
transaction. If a request arrives for the first time with an out-of-order
sequence number, the transaction may be aborted. Replays of previously
handled requests will yield the same response as the first execution.
public RepeatedField<ExecuteBatchDmlRequest.Types.Statement> Statements { get; }
Required. The list of statements to execute in this batch. Statements are
executed serially, such that the effects of statement i are visible to
statement i+1. Each statement must be a DML statement. Execution stops at
the first failed statement; the remaining statements are not executed.
public TransactionSelector Transaction { get; set; }
Required. The transaction to use. Must be a read-write transaction.
To protect against replays, single-use transactions are not supported. The
caller must either supply an existing transaction ID or begin a new
transaction.
[[["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\u003eExecuteBatchDmlRequest\u003c/code\u003e class is used to define a request for batch execution of DML (Data Manipulation Language) statements within the Google Cloud Spanner v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements multiple interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e to support various functionalities, including message handling, equality checks, deep cloning, and buffer management.\u003c/p\u003e\n"],["\u003cp\u003eThe class is designed for batch execution, requiring at least one DML statement and executing them serially within a specified read-write transaction.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExecuteBatchDmlRequest\u003c/code\u003e includes properties for managing the transaction, session, request options, and a sequence number to ensure idempotency.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available for this class is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, with multiple previous versions also accessible ranging from \u003ccode\u003e5.0.0-beta04\u003c/code\u003e down to \u003ccode\u003e3.5.0\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class ExecuteBatchDmlRequest (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.ExecuteBatchDmlRequest)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest) \n\n public sealed class ExecuteBatchDmlRequest : IMessage\u003cExecuteBatchDmlRequest\u003e, IEquatable\u003cExecuteBatchDmlRequest\u003e, IDeepCloneable\u003cExecuteBatchDmlRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class ExecuteBatchDmlRequest.\n\nThe request for \\[ExecuteBatchDml\\]\\[google.spanner.v1.Spanner.ExecuteBatchDml\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ExecuteBatchDmlRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ExecuteBatchDmlRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ExecuteBatchDmlRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ExecuteBatchDmlRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest), [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### ExecuteBatchDmlRequest()\n\n public ExecuteBatchDmlRequest()\n\n### ExecuteBatchDmlRequest(ExecuteBatchDmlRequest)\n\n public ExecuteBatchDmlRequest(ExecuteBatchDmlRequest other)\n\nProperties\n----------\n\n### LastStatements\n\n public bool LastStatements { get; set; }\n\nOptional. If set to true, this request marks the end of the transaction.\nThe transaction should be committed or aborted after these statements\nexecute, and attempts to execute any other requests against this\ntransaction (including reads and queries) will be rejected.\n\nSetting this option may cause some error reporting to be deferred until\ncommit time (e.g. validation of unique constraints). Given this, successful\nexecution of statements should not be assumed until a subsequent Commit\ncall completes successfully.\n\n### RequestOptions\n\n public RequestOptions RequestOptions { get; set; }\n\nCommon options for this request.\n\n### Seqno\n\n public long Seqno { get; set; }\n\nRequired. A per-transaction sequence number used to identify this request.\nThis field makes each request idempotent such that if the request is\nreceived multiple times, at most one will succeed.\n\nThe sequence number must be monotonically increasing within the\ntransaction. If a request arrives for the first time with an out-of-order\nsequence number, the transaction may be aborted. Replays of previously\nhandled requests will yield the same response as the first execution.\n\n### Session\n\n public string Session { get; set; }\n\nRequired. The session in which the DML statements should be performed.\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.ExecuteBatchDmlRequest#Google_Cloud_Spanner_V1_ExecuteBatchDmlRequest_Session) resource name property.\n\n### Statements\n\n public RepeatedField\u003cExecuteBatchDmlRequest.Types.Statement\u003e Statements { get; }\n\nRequired. The list of statements to execute in this batch. Statements are\nexecuted serially, such that the effects of statement `i` are visible to\nstatement `i+1`. Each statement must be a DML statement. Execution stops at\nthe first failed statement; the remaining statements are not executed.\n\nCallers must provide at least one statement.\n\n### Transaction\n\n public TransactionSelector Transaction { get; set; }\n\nRequired. The transaction to use. Must be a read-write transaction.\n\nTo protect against replays, single-use transactions are not supported. The\ncaller must either supply an existing transaction ID or begin a new\ntransaction."]]