Op Englesch liesen Editéieren

Deelen iwwer


CommittableTransaction.BeginCommit(AsyncCallback, Object) Method

Definition

Begins an attempt to commit the transaction asynchronously.

C#
public IAsyncResult BeginCommit(AsyncCallback? asyncCallback, object? asyncState);
C#
public IAsyncResult BeginCommit(AsyncCallback asyncCallback, object asyncState);

Parameters

asyncCallback
AsyncCallback

The AsyncCallback delegate that is invoked when the transaction completes. This parameter can be null, in which case the application is not notified of the transaction's completion. Instead, the application must use the IAsyncResult interface to check for completion and wait accordingly, or call EndCommit(IAsyncResult) to wait for completion.

asyncState
Object

An object, which might contain arbitrary state information, associated with the asynchronous commitment. This object is passed to the callback, and is not interpreted by System.Transactions. A null reference is permitted.

Returns

An IAsyncResult interface that can be used by the caller to check the status of the asynchronous operation, or to wait for the operation to complete.

Remarks

This method returns immediately, before the transaction has been completed. The transaction then commits on a different thread, and the asyncCallback delegate is invoked when it has completed. After this method is called, you do not receive the outcome of the transaction until you call EndCommit.

Notiz

The commit process may complete synchronously inside this method call.

Applies to

Produkt Versiounen
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also