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

EnterState() private method

private EnterState ( InternalTransaction tx ) : void
tx InternalTransaction
return void
        internal override void EnterState(InternalTransaction tx)
        {
            // Assign the state
            CommonEnterState(tx);

            // We are never going to have an DistributedTransaction for this one.
            DistributedTransaction distributedTx = null;
            try
            {
                // Ask the delegation interface to promote the transaction.
                if (tx._durableEnlistment != null)
                {
                    TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
                    if (etwLog.IsEnabled())
                    {
                        etwLog.EnlistmentStatus(tx._durableEnlistment, NotificationCall.Promote);
                    }
                }

                distributedTx = TransactionStatePSPEOperation.PSPEPromote(tx);
                Debug.Assert((distributedTx == null), string.Format(null, "PSPEPromote for non-MSDTC promotion returned a distributed transaction."));
                Debug.Assert((tx.promotedToken != null), string.Format(null, "PSPEPromote for non-MSDTC promotion did not set InternalTransaction.PromotedToken."));
            }
            catch (TransactionPromotionException e)
            {
                tx._innerException = e;
                TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
                if (etwLog.IsEnabled())
                {
                    etwLog.ExceptionConsumed(e);
                }
            }
            finally
            {
                if (tx.promotedToken == null)
                {
                    // There was an exception trying to promote the transaction.
                    tx.State.ChangeStateAbortedDuringPromotion(tx);
                }
            }
        }
TransactionStateDelegatedNonMSDTC