แก้ไข

แชร์ผ่าน


IDocumentWriter<TDocument>.ExecuteTransactionalBatchAsync Method

Definition

Transactionally executes a set of operations.

public:
 System::Threading::Tasks::Task<System::Cloud::DocumentDb::IDatabaseResponse<System::Collections::Generic::IReadOnlyList<System::Cloud::DocumentDb::IDatabaseResponse<TDocument> ^> ^> ^> ^ ExecuteTransactionalBatchAsync(System::Cloud::DocumentDb::RequestOptions<TDocument> ^ requestOptions, System::Collections::Generic::IReadOnlyList<System::Cloud::DocumentDb::BatchItem<TDocument>> ^ itemsToPerformTransactionalBatch, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<System.Collections.Generic.IReadOnlyList<System.Cloud.DocumentDb.IDatabaseResponse<TDocument>>>> ExecuteTransactionalBatchAsync(System.Cloud.DocumentDb.RequestOptions<TDocument> requestOptions, System.Collections.Generic.IReadOnlyList<System.Cloud.DocumentDb.BatchItem<TDocument>> itemsToPerformTransactionalBatch, System.Threading.CancellationToken cancellationToken);
abstract member ExecuteTransactionalBatchAsync : System.Cloud.DocumentDb.RequestOptions<'Document> * System.Collections.Generic.IReadOnlyList<System.Cloud.DocumentDb.BatchItem<'Document>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<System.Collections.Generic.IReadOnlyList<System.Cloud.DocumentDb.IDatabaseResponse<'Document>>>>
Public Function ExecuteTransactionalBatchAsync (requestOptions As RequestOptions(Of TDocument), itemsToPerformTransactionalBatch As IReadOnlyList(Of BatchItem(Of TDocument)), cancellationToken As CancellationToken) As Task(Of IDatabaseResponse(Of IReadOnlyList(Of IDatabaseResponse(Of TDocument))))

Parameters

requestOptions
RequestOptions<TDocument>

The request options.

itemsToPerformTransactionalBatch
IReadOnlyList<BatchItem<TDocument>>

IList<T> to perform transaction batch.

cancellationToken
CancellationToken

The token represents request cancellation.

Returns

A Task containing a IList<T> of IDatabaseResponse<T> that wraps transaction operation response.

Exceptions

Thrown when an error occurred on a client side. For example on a bad request, permissions error or client timeout.

Thrown when an error occurred on a database server side, including internal server error.

Thrown when a request failed but can be retried. This includes throttling and server not available cases.

A generic exception thrown in all other not covered above cases.

Remarks

Transactional batch describes a group of point operations that need to either succeed or fail. If all operations, in the order that are described in the transactional batch, succeed, the transaction is committed. If any operation fails, the entire transaction is rolled back.

Applies to