internal void ClearBaseTransaction() { if (this.baseTransaction == null) { throw new InvalidOperationException(TransactionStrings.BaseTransactionNotSet); } if (this.transactionStack.Peek() != this.baseTransaction) { throw new InvalidOperationException(TransactionStrings.BaseTransactionNotActive); } this.transactionStack.Pop().Dispose(); this.baseTransaction = null; }
internal void SetBaseTransaction(CommittableTransaction transaction, RollbackSeverity severity) { if (this.HasTransaction) { throw new InvalidOperationException(TransactionStrings.BaseTransactionMustBeFirst); } this.transactionStack.Peek(); while ((this.transactionStack.Peek() != null) && (this.transactionStack.Peek().IsRolledBack || this.transactionStack.Peek().IsCommitted)) { this.transactionStack.Pop().Dispose(); } this.baseTransaction = new PSTransaction(transaction, severity); this.transactionStack.Push(this.baseTransaction); }