Exemple #1
0
        public virtual ITransaction CreateTransaction(TransactionMode transactionMode, IsolationMode isolationMode)
        {
            if (transactionMode == TransactionMode.Unspecified)
            {
                transactionMode = ObtainDefaultTransactionMode(transactionMode);
            }

            CheckNotSupportedTransaction(transactionMode);

            if (CurrentTransaction == null &&
                (transactionMode == TransactionMode.Supported ||
                 transactionMode == TransactionMode.NotSupported))
            {
                return(null);
            }

            StandardTransaction transaction = null;

            if (CurrentTransaction != null)
            {
                if (transactionMode == TransactionMode.Requires || transactionMode == TransactionMode.Supported)
                {
                    transaction = (CurrentTransaction as StandardTransaction).CreateChildTransaction();

                    RaiseChildTransactionCreated(transaction, transactionMode, isolationMode);
                }
            }

            if (transaction == null)
            {
                transaction = new StandardTransaction(
                    new TransactionDelegate(RaiseTransactionCommitted),
                    new TransactionDelegate(RaiseTransactionRolledback));

                RaiseTransactionCreated(transaction, transactionMode, isolationMode);
            }

            _transactions.Push(transaction);

            return(transaction);
        }
		public ChildTransaction(StandardTransaction parent) : 
			base(parent.TransactionMode, parent.IsolationMode, parent.DistributedTransaction)
		{
			_parent = parent;
		}
Exemple #3
0
 public ChildTransaction(StandardTransaction parent)
 {
     _parent = parent;
 }