Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

BaseObjectSpace.CommitChanges() Method

Saves all the changes made to the persistent objects belonging to the current Object Space to the database.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public void CommitChanges()

Remarks

Tip

See IObjectSpace.CommitChanges for a code example.

When working with persistent objects, the changes that you make are not saved immediately. Each object change is tracked. To save all the tracked changes, the CommitChanges method is called. This method calls a protected virtual DoCommit method, which must be implemented in the BaseObjectSpace class’ descendants.

After the CommitChanges method is executed, the track list is empty and the BaseObjectSpace.IsModified property is set to false. This raises the BaseObjectSpace.ModifiedChanged event.

In default scenarios, this method is automatically called. But all custom manipulations that you perform with persistent objects must be saved manually via this method.

The following events related to this method are available:

Note

An Object Space is supposed to commit only the objects that were created with its help. Otherwise, an exception must be raised. This must be implemented in the protected virtual CheckLocking method of the BaseObjectSpace class’s descendants.

Implements

See Also