你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ITransaction.CommitAsync Method

Definition

Commit the transaction.

public System.Threading.Tasks.Task CommitAsync();
abstract member CommitAsync : unit -> System.Threading.Tasks.Task
Public Function CommitAsync () As Task

Returns

A task that represents the asynchronous commit operation.

Exceptions

The transaction has been internally faulted by the system. Retry the operation on a new transaction

Thrown when a method call is invalid for the object's current state. Example, transaction used is already terminated: committed or aborted by the user. If this exception is thrown, it is highly likely that there is a bug in the service code of the use of transactions.

The transaction includes updates to IReliableState and the ReplicaRole is not Primary. Only Primary replicas are given write status.

Remarks

You cannot abort a transaction once it has been committed, because all modifications have been persisted and replicated.

Applies to