System.Transactions.PreparingEnlistment.ForceRollback C# (CSharp) Method

ForceRollback() public method

public ForceRollback ( ) : void
return void
        public void ForceRollback()
        {
            TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
            if (etwLog.IsEnabled())
            {
                etwLog.MethodEnter(TraceSourceType.TraceSourceLtm, this);
                etwLog.EnlistmentForceRollback(_internalEnlistment);
            }

            lock (_internalEnlistment.SyncRoot)
            {
                _internalEnlistment.State.ForceRollback(_internalEnlistment, null);
            }

            if (etwLog.IsEnabled())
            {
                etwLog.MethodExit(TraceSourceType.TraceSourceLtm, this);
            }
        }

Same methods

PreparingEnlistment::ForceRollback ( Exception e ) : void
PreparingEnlistment::ForceRollback ( System e ) : void

Usage Example

 public void Prepare(PreparingEnlistment preparingEnlistment)
 {
   if (_transaction.IsValid(false) == false)
     preparingEnlistment.ForceRollback();
   else
     preparingEnlistment.Prepared();
 }
All Usage Examples Of System.Transactions.PreparingEnlistment::ForceRollback