Table of Contents

Class CMSTransactionScope

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Transaction scope. Ensures that all queries run within single transaction.

public class CMSTransactionScope : Trackable<CMSTransactionScope>, ITransactionScope, INotCopyThreadItem
Inheritance
object
CMSTransactionScope
Implements
Inherited Members
Extension Methods

Constructors

CMSTransactionScope(IDataConnection)

Constructor. Opens the connection and begins the transaction.

public CMSTransactionScope(IDataConnection conn = null)

Parameters

conn IDataConnection

Connection to use within all database operations

Fields

mCloseConnection

This scope closes the connection.

protected bool mCloseConnection

Field Value

bool

mCommitTransaction

This scope commits the transaction.

protected bool mCommitTransaction

Field Value

bool

mConnectionScope

Inner connection scope.

protected CMSConnectionScope mConnectionScope

Field Value

CMSConnectionScope

mRollbackTransaction

This scope should rollback the transaction in case of errors.

protected bool mRollbackTransaction

Field Value

bool

mTransactionScope

Transaction scope.

protected TransactionScope mTransactionScope

Field Value

TransactionScope

mUseTransactionScope

If true, .NET transaction scope is used instead of standard transactions.

protected static bool? mUseTransactionScope

Field Value

bool?

Properties

Connection

Connection of the current scope.

public IDataConnection Connection { get; }

Property Value

IDataConnection

IsInTransaction

Returns true if the current code executes in a scope of open transaction

public static bool IsInTransaction { get; }

Property Value

bool

UseTransactionScope

If true, .NET transaction scope is used instead of standard transactions.

public static bool UseTransactionScope { get; set; }

Property Value

bool

Methods

Commit()

Commits the transaction.

public void Commit()

CommitAndBeginNew()

Commits current transaction and begins new transaction.

[Obsolete("Method was not intended for public use and will be removed.")]
[ObsoleteSince(30, 1)]
public void CommitAndBeginNew()

Dispose()

Disposes the object.

public override void Dispose()