当前位置: 首页>>代码示例>>C#>>正文


C# Transaction.EnlistVolatile方法代码示例

本文整理汇总了C#中System.Transactions.Transaction.EnlistVolatile方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.EnlistVolatile方法的具体用法?C# Transaction.EnlistVolatile怎么用?C# Transaction.EnlistVolatile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Transactions.Transaction的用法示例。


在下文中一共展示了Transaction.EnlistVolatile方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SQLiteEnlistment

    internal SQLiteEnlistment(SQLiteConnection cnn, Transaction scope)
    {
      _transaction = cnn.BeginTransaction();
      _scope = scope;

      _scope.EnlistVolatile(this, System.Transactions.EnlistmentOptions.None);
    }
开发者ID:vertica-as,项目名称:sqlite-netFx-source-1.0.88.0,代码行数:7,代码来源:SQLiteEnlistment.cs

示例2: DeveelDbEnlistment

        public DeveelDbEnlistment(DeveelDbConnection connection, Transaction scope)
        {
            transaction = connection.BeginTransaction();

            Scope = scope;
            Scope.EnlistVolatile(this, EnlistmentOptions.None);
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:7,代码来源:DeveelDbEnlistment.cs

示例3: FbEnlistmentNotification

		public FbEnlistmentNotification(FbConnectionInternal connection, Transaction systemTransaction)
		{
			_connection = connection;
			_transaction = connection.BeginTransaction(systemTransaction.IsolationLevel);
			_systemTransaction = systemTransaction;

			_systemTransaction.EnlistVolatile(this, System.Transactions.EnlistmentOptions.None);
		}
开发者ID:nakagami,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:8,代码来源:FbEnlistmentNotification.cs

示例4: SQLiteEnlistment

    internal SQLiteEnlistment(
        SQLiteConnection cnn,
        Transaction scope,
        System.Data.IsolationLevel defaultIsolationLevel,
        bool throwOnUnavailable,
        bool throwOnUnsupported
        )
    {
      _transaction = cnn.BeginTransaction(GetSystemDataIsolationLevel(
          cnn, scope, defaultIsolationLevel, throwOnUnavailable,
          throwOnUnsupported));

      _scope = scope;

      _scope.EnlistVolatile(this, System.Transactions.EnlistmentOptions.None);
    }
开发者ID:rohitlodha,项目名称:DenverDB,代码行数:16,代码来源:SQLiteEnlistment.cs

示例5: SetInteriorTransaction

            public void SetInteriorTransaction(Transaction interiorTransaction, bool needsCommit)
            {
                Fx.Assert(!this.context.IsHostTransaction, "SetInteriorTransaction called for a host transaction.");

                if (this.waitForTransaction != null)
                {
                    throw Fx.Exception.AsError(new InvalidOperationException(SRCore.ExecuteMustBeNested));
                }

                bool success = false;
                try
                {
                    this.waitForTransaction = new AsyncWaitHandle(EventResetMode.ManualReset);
                    interiorTransaction.EnlistVolatile(this, EnlistmentOptions.None);
                    success = true;
                }
                finally
                {
                    if (!success)
                    {
                        if (this.waitForTransaction != null)
                        {
                            this.waitForTransaction.Set();
                        }
                    }
                    else if (needsCommit)
                    {
                        this.transactionToCommit = (CommittableTransaction)interiorTransaction;
                    }
                }
            }
开发者ID:uQr,项目名称:referencesource,代码行数:31,代码来源:InstancePersistenceContext.cs

示例6: RegisterForTransactionNotification

 void RegisterForTransactionNotification(Transaction transaction)
 {
     if (Transaction.Current != null)
     {
         ReceiveContextEnlistmentNotification notification = new ReceiveContextEnlistmentNotification(this);
         transaction.EnlistVolatile(notification, EnlistmentOptions.None);
         Interlocked.Increment(ref this.ambientTransactionCount);
     }
 }
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:9,代码来源:HostedAspNetEnvironment.cs

示例7: TxEnlistment

 public TxEnlistment(Transaction tx)
 {
     tx.EnlistVolatile(this, EnlistmentOptions.None);
 }
开发者ID:pmizel,项目名称:DevMentor.Context.FileContext,代码行数:4,代码来源:TxEnlistment.cs

示例8: CreateVolatileEnlistment

        TransactionException CreateVolatileEnlistment(Transaction transactionToEnlist)
        {
            TransactionException result = null;
            PersistenceContextEnlistment enlistment = null;
            int key = transactionToEnlist.GetHashCode();
            lock (PersistenceContext.Enlistments)
            {
                try
                {
                    if (!PersistenceContext.Enlistments.TryGetValue(key, out enlistment))
                    {
                        enlistment = new PersistenceContextEnlistment(this.PersistenceContext, transactionToEnlist);
                        transactionToEnlist.EnlistVolatile(enlistment, EnlistmentOptions.None);
                        // We don't save of the Enlistment object returned from EnlistVolatile. We don't need
                        // it here. When our PersistenceContextEnlistment object gets notified on Prepare,
                        // Commit, Rollback, or InDoubt, it is provided with the Enlistment object.
                        PersistenceContext.Enlistments.Add(key, enlistment);
                    }
                    else
                    {
                        enlistment.AddToEnlistment(this.PersistenceContext);
                    }
                }
                catch (TransactionException txException)
                {
                    result = txException;

                    // We own the lock but failed to create enlistment.  Manually wake up the next waiter.
                    // We only handle TransactionException, in case of other exception that failed to create enlistment,
                    // It will fallback to Timeout.  This is safe to avoid multiple waiters owning same lock.
                    this.PersistenceContext.ScheduleNextTransactionWaiter();
                }
            }
            return result;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:35,代码来源:TransactionWaitAsyncResult.cs

示例9: SetInteriorTransaction

 public void SetInteriorTransaction(Transaction interiorTransaction, bool needsCommit)
 {
     if (this.waitForTransaction != null)
     {
         throw Fx.Exception.AsError(new InvalidOperationException(SRCore.ExecuteMustBeNested));
     }
     bool flag = false;
     try
     {
         this.waitForTransaction = new AsyncWaitHandle(EventResetMode.ManualReset);
         interiorTransaction.EnlistVolatile((ISinglePhaseNotification) this, EnlistmentOptions.None);
         flag = true;
     }
     finally
     {
         if (!flag)
         {
             if (this.waitForTransaction != null)
             {
                 this.waitForTransaction.Set();
             }
         }
         else if (needsCommit)
         {
             this.transactionToCommit = (CommittableTransaction) interiorTransaction;
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:InstancePersistenceContext.cs

示例10: EventResourceManager

 public EventResourceManager(EventEmitter eventEmitter, Transaction transaction)
 {
     this.eventEmitter = eventEmitter;
     transaction.EnlistVolatile(this, EnlistmentOptions.None);
     changes = new List<RaisedEvent>();
 }
开发者ID:AndyHitchman,项目名称:BlastTrack,代码行数:6,代码来源:EventResourceManager.cs

示例11: VoterBallot

 internal VoterBallot(ITransactionVoterNotifyAsync2 notification, Transaction transaction)
 {
     this.transaction = transaction;
     this.notification = notification;
     this.enlistment = transaction.EnlistVolatile(this, EnlistmentOptions.None);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:VoterBallot.cs


注:本文中的System.Transactions.Transaction.EnlistVolatile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。