当前位置: 首页>>代码示例>>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;未经允许,请勿转载。