public void RollbackTransaction() { TransactionFailureReason reason = new TransactionFailureReason(null); bool done = false; RollbackTransaction(reason, ref done); }
private void NotifyRollbackTransaction(TransactionFailureReason reason, ref bool done) { if (OnRollbackTransactionSpecific != null) { OnRollbackTransactionSpecific(this, reason, ref done); } if (OnRollbackTransaction != null) { OnRollbackTransaction(this, reason); } }
public void ExecuteTransaction() { try { using (TransactionScope scope = TisTransactionScope.Get) { Execute(); scope.Complete(); try { PerformPostCommitTasks(); } catch (Exception exc) { throw new TisException( exc, "Fatal error: PostComplete tasks should not throw exceptions"); } } } catch (Exception oExc) { TransactionFailureReason reason = new TransactionFailureReason(oExc); bool done = false; RollbackTransaction(reason, ref done); if (!done) { throw; } } finally { // Clear transaction ClearTransaction(); } }
private void RollbackTransaction(TransactionFailureReason reason, ref bool done) { lock (this) { // Call RollbackTransaction for each transaction member foreach (ITransactable member in m_transactionMembers) { try { member.RollbackTransaction(); } catch (Exception exc) { Log.WriteException(exc); } } NotifyRollbackTransaction(reason, ref done); PerformRollbackTasks(); ClearTransaction(); } }