Skip to main content
.NET 6.0+

Session.ExplicitBeginTransaction(IsolationLevel) Method

Marks the starting point of a database level transaction that is started with the specified IsolationLevel value.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v23.2.dll

NuGet Package: DevExpress.Xpo

Declaration

public void ExplicitBeginTransaction(
    IsolationLevel isolationLevel
)

Parameters

Name Type Description
isolationLevel IsolationLevel

A IsolationLevel enumeration value, specifying the transaction locking behavior for a session’s connection.

Remarks

The ExplicitBeginTransaction method represents the point at which the data referenced by a session is consistent. All data modifications made after calling the ExplicitBeginTransaction method can be rolled back. This allows data to be returned to this known state of consistency.

Once started, a database level transaction lasts until one of the following occurs:

Note

In a session, you need to use the ExplicitBeginTransaction method, in combination with the Session.BeginTrackingChanges method, that allows for tracking changes made to persistent objects within the opened database level transaction. UnitOfWork provides this capability out of the box, so to simplify tracking changes, you may consider using. In addition, you can simplify the management of database level transactions, by means of ExplicitUnitOfWork.

The ExplicitBeginTransaction method throws an exception if a database level transaction has already been started.

See Also