.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

UnitOfWork.CommitChangesAsync(CancellationToken) Method

Asynchronously commits object changes made in a specified session and notifies upon completion.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v21.1.dll


public Task CommitChangesAsync(
    CancellationToken cancellationToken = default(CancellationToken)

Optional Parameters

Name Type Default Description
cancellationToken CancellationToken


A CancellationToken object that delivers a cancellation notice to the running operation.


Type Description

A Task that commits specified object changes.


A Unit of Work tracks every change to every persistent object during a transaction that can affect a data store. Its CommitChangesAsync method commits all object changes to a data store. The only requirement for this is that the property setters call the XPBaseObject.OnChanged method.

Calling the CommitChangesAsync method automatically calls Session.CommitTransaction (in explicit units of work, ExplicitUnitOfWork.CommitTransaction is called).


If a save operation fails (for example, due to a database constraint violation), the XPO can raise the following exceptions:

See Also