/// <summary> /// Performs necessary rollback actions, clearing the current <see cref="TransactionContext"/> /// </summary> public void Rollback(Enlistment enlistment) { DoRollback(); enlistment.Done(); TransactionContext.Clear(); AfterRollback(); }
/// <summary> /// Performs necessary commit actions, clearing the current <see cref="TransactionContext"/> /// </summary> public void Commit(Enlistment enlistment) { BeforeCommit(); DoCommit(); TransactionContext.Clear(); enlistment.Done(); }
/// <summary> /// Does nothing /// </summary> public void InDoubt(Enlistment enlistment) { try { enlistment.Done(); } finally { TransactionContext.Clear(); } }
/// <summary> /// Runs the cleanup method, ensuring that the currently thread-bound transaction context is cleared /// </summary> public void RunCleanup() { try { Cleanup(); } finally { TransactionContext.Clear(); } }
internal void Run() { Tuple <SendOrPostCallback, object, ITransactionContext> tuple; while (callbacks.TryDequeue(out tuple)) { TransactionContext.Set(tuple.Item3); tuple.Item1(tuple.Item2); TransactionContext.Clear(); } }
public void Dispose() { TransactionContext.Clear(); Cleanup(); }