상속: 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);
     }
 }
예제 #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);
 }
예제 #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();
 }
예제 #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]);
 }
예제 #13
0
파일: Enlistment.cs 프로젝트: dotnet/corefx
 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);
     }
 }
예제 #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)
 {
 }
예제 #18
0
 internal override void ChangeStateCommitting(InternalEnlistment enlistment)
 {
     // Transition to the committing state
     DurableEnlistmentCommitting.EnterState(enlistment);
 }
예제 #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);
 }
예제 #21
0
 internal override void EnlistmentDone(InternalEnlistment enlistment)
 {
     VolatileEnlistmentState._VolatileEnlistmentEnded.EnterState(enlistment);
 }
예제 #22
0
 internal virtual void InDoubt(InternalEnlistment enlistment, Exception e)
 {
     throw TransactionException.CreateEnlistmentStateException(null, enlistment == null ? Guid.Empty : enlistment.DistributedTxId);
 }
예제 #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);
 }
예제 #24
0
파일: Enlistment.cs 프로젝트: mind0n/hive
 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
             );
     }
 }
예제 #25
0
파일: Enlistment.cs 프로젝트: mind0n/hive
 internal Enlistment(
     IEnlistmentNotification twoPhaseNotifications,
     InternalTransaction transaction,
     Transaction atomicTransaction
     )
 {
     this.internalEnlistment = new InternalEnlistment(
         this,
         twoPhaseNotifications,
         transaction,
         atomicTransaction
         );
 }
예제 #26
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     // This would happen in the second pass of a phase 0 wave.
 }
예제 #27
0
 internal override void ChangeStateSinglePhaseCommit(InternalEnlistment enlistment)
 {
     VolatileEnlistmentSPC.EnterState(enlistment);
 }
예제 #28
0
 internal override void InternalIndoubt(InternalEnlistment enlistment)
 {
     // Change the enlistment state to InDoubt.
     VolatileEnlistmentInDoubt.EnterState(enlistment);
 }
예제 #29
0
 internal override void InternalCommitted(InternalEnlistment enlistment)
 {
     VolatileEnlistmentCommitting.EnterState(enlistment);
 }
예제 #30
0
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     VolatileEnlistmentAborting.EnterState(enlistment);
 }
예제 #31
0
 internal override void EnterState(InternalEnlistment enlistment)
 {
     enlistment.State = this;
 }
예제 #32
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     VolatileEnlistmentPreparing.EnterState(enlistment);
 }
예제 #33
0
 internal abstract void EnterState(InternalEnlistment enlistment);
예제 #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);
            }
        }
예제 #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);
 }
예제 #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);
 }
예제 #43
0
 internal override void EnterState(InternalEnlistment enlistment)
 {
     // Set the enlistment state
     enlistment.State = this;
 }
예제 #44
0
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     // Change the enlistment state to aborting.
     VolatileEnlistmentAborting.EnterState(enlistment);
 }
예제 #45
0
파일: Enlistment.cs 프로젝트: mind0n/hive
 internal Enlistment(
     InternalEnlistment internalEnlistment
     )
 {
     this.internalEnlistment = internalEnlistment;
 }
예제 #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.
 }
예제 #47
0
파일: Enlistment.cs 프로젝트: mind0n/hive
 // 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
         );
 }
예제 #48
0
 internal override void InternalAborted(InternalEnlistment enlistment)
 {
     // Already working on it.
 }
예제 #49
0
파일: Enlistment.cs 프로젝트: mind0n/hive
 internal Enlistment(
     IEnlistmentNotification twoPhaseNotifications,
     object syncRoot
     )
 {
     this.internalEnlistment = new RecoveringInternalEnlistment(
         this,
         twoPhaseNotifications,
         syncRoot
         );
 }
예제 #50
0
 internal override void EnlistmentDone(InternalEnlistment enlistment)
 {
     // Move this enlistment to the ended state
     VolatileEnlistmentEnded.EnterState(enlistment);
 }
예제 #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());
            }
        }
예제 #52
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     // This enlistment was told to abort before being told to prepare
 }
예제 #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);
            }
        }
예제 #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();
 }
예제 #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);
 }
예제 #58
0
 internal override void ChangeStatePreparing(InternalEnlistment enlistment)
 {
     enlistment.CheckComplete();
 }
예제 #59
0
 internal PreparingEnlistment(
     InternalEnlistment enlistment
     ) : base(enlistment)
 {
 }
예제 #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);
 }