Inheritance: ISinglePhaseNotificationInternal, IEnlistmentNotificationInternal
 internal override void EnterState(InternalEnlistment enlistment)
 {
     bool flag = false;
     enlistment.State = this;
     Monitor.Exit(enlistment.Transaction);
     try
     {
         if (DiagnosticTrace.Verbose)
         {
             EnlistmentNotificationCallTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), enlistment.EnlistmentTraceId, NotificationCall.SinglePhaseCommit);
         }
         if (enlistment.SinglePhaseNotification != null)
         {
             enlistment.SinglePhaseNotification.SinglePhaseCommit(enlistment.SinglePhaseEnlistment);
         }
         else
         {
             enlistment.PromotableSinglePhaseNotification.SinglePhaseCommit(enlistment.SinglePhaseEnlistment);
         }
         flag = true;
     }
     finally
     {
         if (!flag)
         {
             enlistment.SinglePhaseEnlistment.InDoubt();
         }
         Monitor.Enter(enlistment.Transaction);
     }
 }
Example #2
0
        internal override void EnterState(InternalEnlistment enlistment)
        {
            // Set the enlistment state
            enlistment.State = this;

            Monitor.Exit(enlistment.Transaction);
            try
            {
                TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
                if (etwLog.IsEnabled())
                {
                    etwLog.EnlistmentStatus(enlistment, NotificationCall.Rollback);
                }

                // Send the Rollback notification to the enlistment
                if (enlistment.SinglePhaseNotification != null)
                {
                    enlistment.SinglePhaseNotification.Rollback(enlistment.SinglePhaseEnlistment);
                }
                else
                {
                    enlistment.PromotableSinglePhaseNotification.Rollback(enlistment.SinglePhaseEnlistment);
                }
            }
            finally
            {
                Monitor.Enter(enlistment.Transaction);
            }
        }
 internal override void Aborted(InternalEnlistment enlistment, Exception e)
 {
     if (enlistment.Transaction.innerException == null)
     {
         enlistment.Transaction.innerException = e;
     }
     DurableEnlistmentState._DurableEnlistmentEnded.EnterState(enlistment);
 }
Example #4
0
        internal override void EnlistmentDone(InternalEnlistment enlistment)
        {
            // End this enlistment
            VolatileEnlistmentDone.EnterState(enlistment);

            // Note another enlistment finished.
            enlistment.FinishEnlistment();
        }
 internal override void Aborted(InternalEnlistment enlistment, Exception e)
 {
     DurableEnlistmentState._DurableEnlistmentEnded.EnterState(enlistment);
     if (enlistment.Transaction.innerException == null)
     {
         enlistment.Transaction.innerException = e;
     }
     enlistment.Transaction.State.ChangeStatePromotedAborted(enlistment.Transaction);
 }
 internal override void InDoubt(InternalEnlistment enlistment, Exception e)
 {
     VolatileEnlistmentState._VolatileEnlistmentEnded.EnterState(enlistment);
     if (enlistment.Transaction.innerException == null)
     {
         enlistment.Transaction.innerException = e;
     }
     enlistment.Transaction.State.InDoubtFromEnlistment(enlistment.Transaction);
 }
 internal override void ForceRollback(InternalEnlistment enlistment, Exception e)
 {
     VolatileEnlistmentState._VolatileEnlistmentEnded.EnterState(enlistment);
     if (enlistment.Transaction.innerException == null)
     {
         enlistment.Transaction.innerException = e;
     }
     enlistment.FinishEnlistment();
 }
Example #8
0
        internal override void Aborted(InternalEnlistment enlistment, Exception e)
        {
            if (enlistment.Transaction._innerException == null)
            {
                enlistment.Transaction._innerException = e;
            }

            // Transition to the ended state
            DurableEnlistmentEnded.EnterState(enlistment);
        }
 internal override void ForceRollback(InternalEnlistment enlistment, Exception e)
 {
     Monitor.Exit(enlistment.SyncRoot);
     try
     {
         enlistment.PromotedEnlistment.ForceRollback(e);
     }
     finally
     {
         Monitor.Enter(enlistment.SyncRoot);
     }
 }
 internal override void Aborted(InternalEnlistment enlistment, Exception e)
 {
     Monitor.Exit(enlistment.SyncRoot);
     try
     {
         enlistment.PromotedEnlistment.Aborted(e);
     }
     finally
     {
         Monitor.Enter(enlistment.SyncRoot);
     }
 }
 internal override void Prepared(InternalEnlistment enlistment)
 {
     Monitor.Exit(enlistment.SyncRoot);
     try
     {
         enlistment.PromotedEnlistment.Prepared();
     }
     finally
     {
         Monitor.Enter(enlistment.SyncRoot);
     }
 }
 protected void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
 {
     if (enlistments.volatileEnlistmentCount == enlistments.volatileEnlistmentSize)
     {
         InternalEnlistment[] destinationArray = new InternalEnlistment[enlistments.volatileEnlistmentSize + 8];
         if (enlistments.volatileEnlistmentSize > 0)
         {
             Array.Copy(enlistments.volatileEnlistments, destinationArray, enlistments.volatileEnlistmentSize);
         }
         enlistments.volatileEnlistmentSize += 8;
         enlistments.volatileEnlistments = destinationArray;
     }
     enlistments.volatileEnlistments[enlistments.volatileEnlistmentCount] = enlistment.InternalEnlistment;
     enlistments.volatileEnlistmentCount++;
     VolatileEnlistmentState._VolatileEnlistmentActive.EnterState(enlistments.volatileEnlistments[enlistments.volatileEnlistmentCount - 1]);
 }
Example #13
0
 internal Enlistment(
     Guid resourceManagerIdentifier,
     InternalTransaction transaction,
     IEnlistmentNotification twoPhaseNotifications,
     ISinglePhaseNotification singlePhaseNotifications,
     Transaction atomicTransaction)
 {
     _internalEnlistment = new DurableInternalEnlistment(
         this,
         resourceManagerIdentifier,
         transaction,
         twoPhaseNotifications,
         singlePhaseNotifications,
         atomicTransaction
         );
 }
 internal override void EnterState(InternalEnlistment enlistment)
 {
     enlistment.State = this;
     Monitor.Exit(enlistment.Transaction);
     try
     {
         if (DiagnosticTrace.Verbose)
         {
             EnlistmentNotificationCallTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), enlistment.EnlistmentTraceId, NotificationCall.Prepare);
         }
         enlistment.EnlistmentNotification.Prepare(enlistment.PreparingEnlistment);
     }
     finally
     {
         Monitor.Enter(enlistment.Transaction);
     }
 }
Example #15
0
        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.Rollback);
                }

                enlistment.EnlistmentNotification.Rollback(enlistment.SinglePhaseEnlistment);
            }
            finally
            {
                Monitor.Enter(enlistment.Transaction);
            }
        }
 internal override void EnterState(InternalEnlistment enlistment)
 {
     enlistment.State = this;
     Monitor.Exit(enlistment.Transaction);
     try
     {
         if (DiagnosticTrace.Verbose)
         {
             EnlistmentNotificationCallTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), enlistment.EnlistmentTraceId, NotificationCall.Rollback);
         }
         if (enlistment.SinglePhaseNotification != null)
         {
             enlistment.SinglePhaseNotification.Rollback(enlistment.SinglePhaseEnlistment);
         }
         else
         {
             enlistment.PromotableSinglePhaseNotification.Rollback(enlistment.SinglePhaseEnlistment);
         }
     }
     finally
     {
         Monitor.Enter(enlistment.Transaction);
     }
 }
 internal PreparingEnlistment(InternalEnlistment enlistment) : base(enlistment)
 {
 }
Example #18
0
 internal override void ChangeStateCommitting(InternalEnlistment enlistment)
 {
     // Transition to the committing state
     DurableEnlistmentCommitting.EnterState(enlistment);
 }
Example #19
0
 internal override void Committed(InternalEnlistment enlistment)
 {
     VolatileEnlistmentEnded.EnterState(enlistment);
     Debug.Assert(enlistment.Transaction.State != null);
     enlistment.Transaction.State.ChangeStateTransactionCommitted(enlistment.Transaction);
 }
 internal virtual void Committed(InternalEnlistment enlistment)
 {
     throw TransactionException.CreateEnlistmentStateException(SR.GetString(SR.TraceSourceLtm), null);
 }
Example #21
0
 internal override void EnlistmentDone(InternalEnlistment enlistment)
 {
     VolatileEnlistmentState._VolatileEnlistmentEnded.EnterState(enlistment);
 }
Example #22
0
 internal virtual void InDoubt(InternalEnlistment enlistment, Exception e)
 {
     throw TransactionException.CreateEnlistmentStateException(null, enlistment == null ? Guid.Empty : enlistment.DistributedTxId);
 }
Example #23
0
 internal virtual void ChangeStateSinglePhaseCommit(InternalEnlistment enlistment)
 {
     Debug.Assert(false, string.Format(null, "Invalid Event for InternalEnlistment State; Current State: {0}", GetType()));
     throw TransactionException.CreateEnlistmentStateException(null, enlistment == null ? Guid.Empty : enlistment.DistributedTxId);
 }
Example #24
0
 internal Enlistment(
     InternalTransaction transaction, 
     IEnlistmentNotification twoPhaseNotifications,
     ISinglePhaseNotification singlePhaseNotifications,
     Transaction atomicTransaction,
     EnlistmentOptions enlistmentOptions
     )
 {
     if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != 0)
     {
         this.internalEnlistment = new InternalEnlistment(
             this,
             transaction,
             twoPhaseNotifications,
             singlePhaseNotifications,
             atomicTransaction
             );
     }
     else
     {
             this.internalEnlistment = new Phase1VolatileEnlistment(
             this,
             transaction,
             twoPhaseNotifications,
             singlePhaseNotifications,
             atomicTransaction
             );
     }
 }
Example #25
0
 internal Enlistment(
     IEnlistmentNotification twoPhaseNotifications,
     InternalTransaction transaction,
     Transaction atomicTransaction
     )
 {
     this.internalEnlistment = new InternalEnlistment(
         this,
         twoPhaseNotifications,
         transaction,
         atomicTransaction
         );
 }
Example #26
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     // This would happen in the second pass of a phase 0 wave.
 }
Example #27
0
 internal override void ChangeStateSinglePhaseCommit(InternalEnlistment enlistment)
 {
     VolatileEnlistmentSPC.EnterState(enlistment);
 }
Example #28
0
 internal override void InternalIndoubt(InternalEnlistment enlistment)
 {
     // Change the enlistment state to InDoubt.
     VolatileEnlistmentInDoubt.EnterState(enlistment);
 }
Example #29
0
 internal override void InternalCommitted(InternalEnlistment enlistment)
 {
     VolatileEnlistmentCommitting.EnterState(enlistment);
 }
Example #30
0
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     VolatileEnlistmentAborting.EnterState(enlistment);
 }
Example #31
0
 internal override void EnterState(InternalEnlistment enlistment)
 {
     enlistment.State = this;
 }
Example #32
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     VolatileEnlistmentPreparing.EnterState(enlistment);
 }
Example #33
0
 internal abstract void EnterState(InternalEnlistment enlistment);
Example #34
0
        internal void EnlistmentCommitted(InternalEnlistment enlistment)
        {
            Debug.Assert(enlistment != null, "Enlistment needed for the ETW event.");

            if (IsEnabled(EventLevel.Verbose, ALL_KEYWORDS))
            {
                EnlistmentCommitted(
                    enlistment.EnlistmentTraceId.EnlistmentIdentifier);
            }
        }
Example #35
0
 internal virtual byte[] RecoveryInformation(InternalEnlistment enlistment)
 {
     throw TransactionException.CreateEnlistmentStateException(null, enlistment == null ? Guid.Empty : enlistment.DistributedTxId);
 }
 internal override void ChangeStateSinglePhaseCommit(InternalEnlistment enlistment)
 {
     VolatileEnlistmentState._VolatileEnlistmentSPC.EnterState(enlistment);
 }
 internal virtual void InDoubt(InternalEnlistment enlistment, Exception e)
 {
     throw TransactionException.CreateEnlistmentStateException(SR.GetString(SR.TraceSourceLtm), null);
 }
 internal override void EnterState(InternalEnlistment enlistment)
 {
     enlistment.State = this;
 }
 internal virtual void ChangeStateSinglePhaseCommit(InternalEnlistment enlistment)
 {
     Debug.Assert(false, string.Format(null, "Invalid Event for InternalEnlistment State; Current State: {0}", this.GetType()));
     throw TransactionException.CreateEnlistmentStateException(SR.GetString(SR.TraceSourceLtm), null);
 }
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     VolatileEnlistmentState._VolatileEnlistmentPreparing.EnterState(enlistment);
 }
Example #41
0
 internal override void ChangeStateDelegated(InternalEnlistment enlistment)
 {
     // This is a valid state transition.
     DurableEnlistmentDelegated.EnterState(enlistment);
 }
 internal virtual byte[] RecoveryInformation(InternalEnlistment enlistment)
 {
     throw TransactionException.CreateEnlistmentStateException(SR.GetString(SR.TraceSourceLtm), null);
 }
Example #43
0
 internal override void EnterState(InternalEnlistment enlistment)
 {
     // Set the enlistment state
     enlistment.State = this;
 }
Example #44
0
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     // Change the enlistment state to aborting.
     VolatileEnlistmentAborting.EnterState(enlistment);
 }
Example #45
0
 internal Enlistment(
     InternalEnlistment internalEnlistment
     )
 {
     this.internalEnlistment = internalEnlistment;
 }
Example #46
0
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     // If this event comes from multiple places just ignore it.  Continue
     // waiting for the enlistment to respond so that we can respond to it.
 }
Example #47
0
 // This constructor is for a promotable single phase enlistment.
 internal Enlistment(
     InternalTransaction transaction, 
     IPromotableSinglePhaseNotification promotableSinglePhaseNotification,
     Transaction atomicTransaction
     )
 {
     this.internalEnlistment = new PromotableInternalEnlistment(
         this,
         transaction,
         promotableSinglePhaseNotification,
         atomicTransaction
         );
 }
Example #48
0
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     // Already working on it.
 }
Example #49
0
 internal Enlistment(
     IEnlistmentNotification twoPhaseNotifications,
     object syncRoot
     )
 {
     this.internalEnlistment = new RecoveringInternalEnlistment(
         this,
         twoPhaseNotifications,
         syncRoot
         );
 }
Example #50
0
 internal override void EnlistmentDone(InternalEnlistment enlistment)
 {
     // Move this enlistment to the ended state
     VolatileEnlistmentEnded.EnterState(enlistment);
 }
Example #51
0
        internal void EnlistmentStatus(InternalEnlistment enlistment, NotificationCall notificationCall)
        {
            Debug.Assert(enlistment != null, "Enlistment needed for the ETW event.");

            if (IsEnabled(EventLevel.Verbose, ALL_KEYWORDS))
            {
                EnlistmentStatus(enlistment.EnlistmentTraceId.EnlistmentIdentifier, notificationCall.ToString());
            }
        }
Example #52
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     // This enlistment was told to abort before being told to prepare
 }
Example #53
0
        internal void EnlistmentInDoubt(InternalEnlistment enlistment)
        {
            Debug.Assert(enlistment != null, "Enlistment needed for the ETW event.");

            if (IsEnabled(EventLevel.Warning, ALL_KEYWORDS))
            {
                EnlistmentInDoubt(
                    enlistment.EnlistmentTraceId.EnlistmentIdentifier);
            }
        }
Example #54
0
 internal override void InternalCommitted(InternalEnlistment enlistment)
 {
     // Ignore this in case the enlistment gets here before
     // the transaction tells it to do so
 }
 internal override void EnlistmentDone(InternalEnlistment enlistment)
 {
     VolatileEnlistmentState._VolatileEnlistmentDone.EnterState(enlistment);
     enlistment.FinishEnlistment();
 }
Example #56
0
 internal override void InDoubt(InternalEnlistment enlistment, Exception?e)
 {
     // Ignore this in case the enlistment gets here before
     // the transaction tells it to do so
 }
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     VolatileEnlistmentState._VolatileEnlistmentAborting.EnterState(enlistment);
 }
Example #58
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     enlistment.CheckComplete();
 }
Example #59
0
 internal PreparingEnlistment(
     InternalEnlistment enlistment
     ) : base(enlistment)
 {
 }
Example #60
0
 // Override of get_RecoveryInformation to be more specific with the exception string.
 internal override byte[] RecoveryInformation(InternalEnlistment enlistment)
 {
     throw TransactionException.CreateInvalidOperationException(TraceSourceType.TraceSourceLtm,
                                                                SR.VolEnlistNoRecoveryInfo, null, enlistment == null ? Guid.Empty : enlistment.DistributedTxId);
 }