Skip to main content
.NET 8.0+

Session.FlushChangesAsync(AsyncCommitCallback) Method

Asynchronously saves changes made to persistent objects to a data store, clears a list of tracked changes and notifies upon completion.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.2.dll

NuGet Package: DevExpress.Xpo

#Declaration

public object FlushChangesAsync(
    AsyncCommitCallback callback
)

#Parameters

Name Type Description
callback AsyncCommitCallback

An AsyncCommitCallback delegate to be called after changes have been saved and a list of tracked changes has been cleared. This collection is passed as a parameter to callback. Use a callback to store the exception information passed as a parameter, and use this information later to raise the exception again, within the original thread. Do not raise exceptions or modify persistent objects within a callback.

#Returns

Type Description
Object

An object identifying the current asynchronous operation, intended for internal use.

#Remarks

Call this method to asynchronously save any changes made to persistent objects after the Session.TrackingChanges property has been set to true. To discard changes and clear a list of tracked changes, call the Session.DropChanges method.

When a list of tracked changes is about to be processed, the Session.BeforeFlushChanges event is raised. After a list of tracked changes has been cleared, the Session.AfterFlushChanges event is raised.

Note

Calling the FlushChangesAsync method sets the Session.TrackingChanges property to false. This method is automatically called when a session or unit of work asynchronously commits a transaction or changes made to persistent objects.

See Also