コード例 #1
0
 /// <summary>
 /// Cancels the transaction.
 /// </summary>
 public void CancelTransaction()
 {
     if (TransactionStack.Count > 0)
     {
         TransactionStack.Pop();
     }
 }
コード例 #2
0
ファイル: ActionManager.cs プロジェクト: Spharah/Warewolf-ESB
        internal void CommitTransaction()
        {
            if (TransactionStack.Count == 0)
            {
                throw new InvalidOperationException("ActionManager.CommitTransaction was called when there is no open transaction (TransactionStack is empty). Please examine the stack trace of this exception to find code which called CommitTransaction one time too many. Normally you don't call OpenTransaction and CommitTransaction directly, but use using(var t = Transaction.Create(Root)) instead.");
            }
            ITransaction transaction = TransactionStack.Pop();

            if (transaction.AccumulatingAction.Count > 0)
            {
                RecordAction(transaction.AccumulatingAction);
            }
        }
コード例 #3
0
        } // OpenTransaction

        public static void CommitTransaction()
        {
            if (TransactionStack.Count == 0)
            {
                throw new InvalidOperationException(
                    "ActionManager.CommitTransaction was called"
                    + " when there is no open transaction (TransactionStack is empty)."
                    + " Please examine the stack trace of this exception to find code"
                    + " which called CommitTransaction one time too many."
                    + " Normally you don't call OpenTransaction and CommitTransaction directly,"
                    + " but use using(var t = Transaction.Create(Root)) instead.");
            }

            Transaction committing = TransactionStack.Pop();

            if (committing.HasActions())
                RecordAction(committing);
        } // CommitTransaction