Пример #1
0
        public void Rollback()
        {
            switch (State)
            {
            case TransactionState.Started:
                _service.Abort();
                State = TransactionState.Aborted;
                break;

            case TransactionState.Aborted:
                break;

            case TransactionState.Completed:
                throw new ArgumentException("Transaction already completed, cannot abort");

            case TransactionState.Canceled:
                throw new TransactionCancelledException();
            }
        }
Пример #2
0
 /// <summary>
 /// Rollback all open transactions
 /// </summary>
 public void Rollback()
 {
     _transaction.Abort();
 }