System.Transactions.TransactionStateAborted.EnterState C# (CSharp) Method

EnterState() private method

private EnterState ( InternalTransaction tx ) : void
tx InternalTransaction
return void
        internal override void EnterState(InternalTransaction tx)
        {
            base.EnterState(tx);

            // Set the transaction state
            CommonEnterState(tx);

            // Do NOT mark the committable transaction as complete because it is aborting.

            // Notify the enlistments that the transaction has aborted
            for (int i = 0; i < tx._phase0Volatiles._volatileEnlistmentCount; i++)
            {
                tx._phase0Volatiles._volatileEnlistments[i]._twoPhaseState.InternalAborted(tx._phase0Volatiles._volatileEnlistments[i]);
            }

            for (int i = 0; i < tx._phase1Volatiles._volatileEnlistmentCount; i++)
            {
                tx._phase1Volatiles._volatileEnlistments[i]._twoPhaseState.InternalAborted(tx._phase1Volatiles._volatileEnlistments[i]);
            }

            // Notify the durable enlistment
            if (tx._durableEnlistment != null)
            {
                tx._durableEnlistment.State.InternalAborted(tx._durableEnlistment);
            }

            // Remove this from the timeout list
            TransactionManager.TransactionTable.Remove(tx);

            TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
            if (etwLog.IsEnabled())
            {
                etwLog.TransactionTimeout(tx.TransactionTraceId);
            }

            // Fire Completion for anyone listening
            tx.FireCompletion();

            // Check to see if we need to release some waiter.
            if (tx._asyncCommit)
            {
                tx.SignalAsyncCompletion();
            }
        }