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

EnterState() private method

private EnterState ( InternalEnlistment enlistment ) : void
enlistment InternalEnlistment
return void
        internal override void EnterState(InternalEnlistment enlistment)
        {
            // Set the enlistment state
            enlistment.State = this;

            Monitor.Exit(enlistment.Transaction);
            try // Don't hold this lock while calling into the application code.
            {
                TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
                if (etwLog.IsEnabled())
                {
                    etwLog.EnlistmentStatus(enlistment, NotificationCall.InDoubt);
                }

                // Forward the notification to the enlistment
                enlistment.EnlistmentNotification.InDoubt(enlistment.PreparingEnlistment);
            }
            finally
            {
                Monitor.Enter(enlistment.Transaction);
            }
        }

Usage Example

 internal override void InternalIndoubt(InternalEnlistment enlistment)
 {
     // Change the enlistment state to InDoubt.
     VolatileEnlistmentInDoubt.EnterState(enlistment);
 }
VolatileEnlistmentInDoubt