Session.CommitTransactionAsync(CancellationToken) Method
Asynchronously commits object changes made within a transaction, completes the transaction, and notifies upon completion.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.2.dll
NuGet Package: DevExpress.Xpo
#Declaration
public virtual Task CommitTransactionAsync(
CancellationToken cancellationToken = default(CancellationToken)
)
#Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
cancellation |
Cancellation |
null | A Cancellation |
#Returns
Type | Description |
---|---|
Task | A Task that commits object changes made within a transaction and completes the transaction. |
#Remarks
To start a transaction, use the Session.BeginTransaction method. To commit all data modifications made since the start of the transaction and complete the transaction, call the CommitTransactionAsync or Session.CommitTransaction method. To discard these modifications, call the Session.RollbackTransaction method.
To determine if a transaction is in progress, use the Session.InTransaction property.
After the CommitTransactionAsync method is called, the Session.BeforeCommitTransaction event is raised.
Note
In a Nested Units of Work, calling the Commit