當前位置: 首頁>>代碼示例>>C#>>正文


C# Transactions.InternalEnlistment類代碼示例

本文整理匯總了C#中System.Transactions.InternalEnlistment的典型用法代碼示例。如果您正苦於以下問題:C# InternalEnlistment類的具體用法?C# InternalEnlistment怎麽用?C# InternalEnlistment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InternalEnlistment類屬於System.Transactions命名空間,在下文中一共展示了InternalEnlistment類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EnterState

        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);
            }
        }
開發者ID:dotnet,項目名稱:corefx,代碼行數:29,代碼來源:DurableEnlistmentState.cs

示例2: EnterState

 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);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:30,代碼來源:DurableEnlistmentCommitting.cs

示例3: EnlistmentDone

        internal override void EnlistmentDone(InternalEnlistment enlistment)
        {
            // End this enlistment
            VolatileEnlistmentDone.EnterState(enlistment);

            // Note another enlistment finished.
            enlistment.FinishEnlistment();
        }
開發者ID:dotnet,項目名稱:corefx,代碼行數:8,代碼來源:VolatileEnlistmentState.cs

示例4: Aborted

 internal override void Aborted(InternalEnlistment enlistment, Exception e)
 {
     if (enlistment.Transaction.innerException == null)
     {
         enlistment.Transaction.innerException = e;
     }
     DurableEnlistmentState._DurableEnlistmentEnded.EnterState(enlistment);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:DurableEnlistmentAborting.cs

示例5: ForceRollback

 internal override void ForceRollback(InternalEnlistment enlistment, Exception e)
 {
     VolatileEnlistmentState._VolatileEnlistmentEnded.EnterState(enlistment);
     if (enlistment.Transaction.innerException == null)
     {
         enlistment.Transaction.innerException = e;
     }
     enlistment.FinishEnlistment();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:VolatileEnlistmentPreparingAborting.cs

示例6: InDoubt

 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);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:VolatileEnlistmentSPC.cs

示例7: Aborted

 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);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:DurableEnlistmentDelegated.cs

示例8: Aborted

        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);
        }
開發者ID:dotnet,項目名稱:corefx,代碼行數:10,代碼來源:DurableEnlistmentState.cs

示例9: Prepared

 internal override void Prepared(InternalEnlistment enlistment)
 {
     Monitor.Exit(enlistment.SyncRoot);
     try
     {
         enlistment.PromotedEnlistment.Prepared();
     }
     finally
     {
         Monitor.Enter(enlistment.SyncRoot);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:12,代碼來源:EnlistmentStatePromoted.cs

示例10: Aborted

 internal override void Aborted(InternalEnlistment enlistment, Exception e)
 {
     Monitor.Exit(enlistment.SyncRoot);
     try
     {
         enlistment.PromotedEnlistment.Aborted(e);
     }
     finally
     {
         Monitor.Enter(enlistment.SyncRoot);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:12,代碼來源:EnlistmentStatePromoted.cs

示例11: ForceRollback

 internal override void ForceRollback(InternalEnlistment enlistment, Exception e)
 {
     Monitor.Exit(enlistment.SyncRoot);
     try
     {
         enlistment.PromotedEnlistment.ForceRollback(e);
     }
     finally
     {
         Monitor.Enter(enlistment.SyncRoot);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:12,代碼來源:EnlistmentStatePromoted.cs

示例12: AddVolatileEnlistment

 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]);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:16,代碼來源:TransactionState.cs

示例13: Enlistment

 internal Enlistment(
     Guid resourceManagerIdentifier,
     InternalTransaction transaction,
     IEnlistmentNotification twoPhaseNotifications,
     ISinglePhaseNotification singlePhaseNotifications,
     Transaction atomicTransaction)
 {
     _internalEnlistment = new DurableInternalEnlistment(
         this,
         resourceManagerIdentifier,
         transaction,
         twoPhaseNotifications,
         singlePhaseNotifications,
         atomicTransaction
         );
 }
開發者ID:dotnet,項目名稱:corefx,代碼行數:16,代碼來源:Enlistment.cs

示例14: EnterState

 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);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:17,代碼來源:VolatileEnlistmentPreparing.cs

示例15: EnterState

        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);
            }
        }
開發者ID:dotnet,項目名稱:corefx,代碼行數:21,代碼來源:VolatileEnlistmentState.cs


注:本文中的System.Transactions.InternalEnlistment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。