C# Class Summer.Batch.Common.Transaction.TransactionScopeManager

Utility class for managing transaction scopes.
Datei anzeigen Open project: SummerBatch/SummerBatch

Public Methods

Method Description
CreateScope ( TransactionScopeOption scopeOption = TransactionScopeOption.Required, IsolationLevel isolationLevel = IsolationLevel.ReadCommitted, System.TimeSpan timeout = null ) : TransactionScope

Creates a new transaction scope with the given options and registers the ITransactionSynchronization and IEnlistmentNotification with the current transaction.

RegisterResource ( IEnlistmentNotification resource ) : void

Registers a new IEnlistmentNotification.

RegisterTransactionSynchronization ( TransactionScope scope, ITransactionSynchronization synchronization ) : void

Registers a new ITransactionSynchronization to a scope.

UnregisterResource ( IEnlistmentNotification resource ) : void

Unregisters a new IEnlistmentNotification.

Private Methods

Method Description
GetIsolationLevel ( IsolationLevel defaultIsolationLevel ) : IsolationLevel
GetTransactionCompleted ( TransactionScope scope ) : TransactionCompletedEventHandler
LogTransactionIfAborted ( TransactionEventArgs args ) : void

Method Details

CreateScope() public static method

Creates a new transaction scope with the given options and registers the ITransactionSynchronization and IEnlistmentNotification with the current transaction.
public static CreateScope ( TransactionScopeOption scopeOption = TransactionScopeOption.Required, IsolationLevel isolationLevel = IsolationLevel.ReadCommitted, System.TimeSpan timeout = null ) : TransactionScope
scopeOption TransactionScopeOption The scope options to use, by default.
isolationLevel IsolationLevel The isolation level, by default.
timeout System.TimeSpan The transaction timeout, by default.
return System.Transactions.TransactionScope

RegisterResource() public static method

Registers a new IEnlistmentNotification.
public static RegisterResource ( IEnlistmentNotification resource ) : void
resource IEnlistmentNotification the resource to register
return void

RegisterTransactionSynchronization() public static method

Registers a new ITransactionSynchronization to a scope.
public static RegisterTransactionSynchronization ( TransactionScope scope, ITransactionSynchronization synchronization ) : void
scope System.Transactions.TransactionScope the scope to register the synchronization to
synchronization ITransactionSynchronization the synchronization to register
return void

UnregisterResource() public static method

Unregisters a new IEnlistmentNotification.
public static UnregisterResource ( IEnlistmentNotification resource ) : void
resource IEnlistmentNotification the resource to unregister
return void