Begin() public method

public Begin ( ) : void
return void
コード例 #1
0
        internal override void DoStartTransaction()
        {
            if (!TransactionContext.InNetTransaction)
            {
                if (Transaction.Current != null)
                {
                    Tracer.Debug("NetTxSession detected Ambient Transaction, start new TX with broker");

                    // Start a new .NET style transaction, this could be distributed
                    // or it could just be a Local transaction that could become
                    // distributed later.
                    TransactionContext.Begin(Transaction.Current);
                }
            }
        }
コード例 #2
0
ファイル: NetTxSession.cs プロジェクト: ioxuy/meijing-ui
        private void EnrollInSpecifiedTransaction(Transaction tx)
        {
            if (TransactionContext.InNetTransaction)
            {
                Tracer.Warn("Enlist attempted while a Net TX was Active.");
                throw new InvalidOperationException("Session is Already enlisted in a Transaction");
            }

            if (Transaction.Current != null && !Transaction.Current.Equals(tx))
            {
                Tracer.Warn("Enlist attempted with a TX that doesn't match the Ambient TX.");
                throw new ArgumentException("Specified TX must match the ambient TX if set.");
            }

            // Start a new .NET style transaction, this could be distributed
            // or it could just be a Local transaction that could become
            // distributed later.
            TransactionContext.Begin(tx);
        }