ExplicitUnitOfWork.RollbackTransaction() Method
Rolls back a database level transaction to its starting point, discarding any changes made within it.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.2.dll
Declaration
Remarks
All data modifications made since the ExplicitUnitOfWork.BeginTransaction method call can be committed (ExplicitUnitOfWork.CommitTransaction, ExplicitUnitOfWork.CommitTransactionAsync, UnitOfWork.CommitChanges, or UnitOfWork.CommitChangesAsync), or discarded (RollbackTransaction). Disposing of an explicit unit of work automatically rolls back any pending data modifications.
Calling the RollbackTransaction method performs the following:
- Discards all data modifications via the Session.DropChanges method call.
- Raises the Session.BeforeRollbackTransaction event. Once a database level transaction is rolled back, the Session.AfterRollbackTransaction event is raised.
Note
An object’s state modified within a transaction is not automatically returned to its former state by the RollbackTransaction method call. In order to refresh the object’s state, use the XPBaseObject.Reload method.