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


C# Transactions.SinglePhaseEnlistment类代码示例

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


SinglePhaseEnlistment类属于System.Transactions命名空间,在下文中一共展示了SinglePhaseEnlistment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SinglePhaseCommit

 public void SinglePhaseCommit(SinglePhaseEnlistment en)
 {
     if (en == null)
     {
         throw new ArgumentNullException("en");
     }
     try
     {
         this.handle.WaitOne();
     }
     catch (ObjectDisposedException)
     {
     }
     lock (this.syncRoot)
     {
         try
         {
             this.transaction.Commit();
             en.Committed();
         }
         catch (Exception exception)
         {
             en.Aborted(exception);
         }
         finally
         {
             if ((this.connection != null) && (this.connection.State != ConnectionState.Closed))
             {
                 this.connection.Close();
                 this.connection = null;
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:34,代码来源:LocalTransaction.cs

示例2: Rollback

 public void Rollback(SinglePhaseEnlistment en)
 {
     if (en == null)
     {
         throw new ArgumentNullException("en");
     }
     try
     {
         this.handle.WaitOne();
     }
     catch (ObjectDisposedException)
     {
     }
     lock (this.syncRoot)
     {
         if (this.transaction != null)
         {
             this.transaction.Dispose();
         }
         if ((this.connection != null) && (this.connection.State != ConnectionState.Closed))
         {
             this.connection.Close();
             this.connection = null;
         }
         en.Aborted();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:LocalTransaction.cs

示例3: SinglePhaseCommit

		/// <summary>
		/// Notifies an enlisted object that the transaction is being committed.
		/// </summary>
		/// <param name="singlePhaseEnlistment">A <see cref="T:System.Transactions.SinglePhaseEnlistment"/> interface used to send a response to the transaction manager.</param>
		public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
		{
			onTxComplete();

			session.Commit(GetLocalOrDistributedTransactionId(transaction));
			singlePhaseEnlistment.Committed();
		}
开发者ID:jtmueller,项目名称:ravendb,代码行数:11,代码来源:PromotableRavenClientEnlistment.cs

示例4:

		void IPromotableSinglePhaseNotification.SinglePhaseCommit( SinglePhaseEnlistment singlePhaseEnlistment ) {
			this.simpleTransaction.Commit();
			singlePhaseEnlistment.Committed();
			DriverTransactionManager.RemoveDriverInTransaction( this.baseTransaction );
			this.connection.driver.CurrentTransaction = null;
			if( this.connection.State == ConnectionState.Closed ) {
				this.connection.CloseFully();
			}
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:9,代码来源:MySqlPromotableTransaction.cs

示例5: SinglePhaseCommit

    public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
    {
      simpleTransaction.Commit();
      singlePhaseEnlistment.Committed();
      DriverTransactionManager.RemoveDriverInTransaction(baseTransaction);

      if (connection.State == ConnectionState.Closed)
        connection.CloseFully();
    }
开发者ID:BjkGkh,项目名称:R106,代码行数:9,代码来源:MySqlPromotableTransaction.cs

示例6:

        void IPromotableSinglePhaseNotification.Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
        {
            simpleTransaction.Rollback();
            singlePhaseEnlistment.Aborted();
            DriverTransactionManager.RemoveDriverInTransaction(baseTransaction);

            connection.driver.CurrentTransaction = null;

            if (connection.State == ConnectionState.Closed)
                connection.CloseFully();
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:11,代码来源:MySqlPromotableTransaction.cs

示例7: SinglePhaseCommit

 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     try
     {
         Neo4jTransaction.DoCommit(_transactionExecutionEnvironment);
         singlePhaseEnlistment.Committed();
     }
     finally
     {
         singlePhaseEnlistment.Aborted();
     }
 }
开发者ID:albumprinter,项目名称:Neo4jClient,代码行数:12,代码来源:Neo4jTransactionResourceManager.cs

示例8: SinglePhaseCommit

 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     try
     {
         Commit();
         singlePhaseEnlistment.Done();
     }
     catch (Exception)
     {
         //on a callback thread, can't throw
     }
 }
开发者ID:jmptrader,项目名称:LightningQueues,代码行数:12,代码来源:TransactionEnlistment.cs

示例9: SinglePhaseCommit

        public void SinglePhaseCommit(SinglePhaseEnlistment en)
        {
            if (en == null)
                throw new ArgumentNullException("en");

            //
            // Wait until IPendingWork members have completed (WinOE bugs 17580 and 13395)
            try
            {
                handle.WaitOne();
            }
            catch (ObjectDisposedException)
            {
                // If an ObjectDisposedException is thrown because
                // the WaitHandle has already closed, nothing to worry
                // about. Move on.
            }

            lock (syncRoot)
            {
                try
                {
                    this.transaction.Commit();
                    en.Committed();
                }
                catch (Exception e)
                {
                    en.Aborted(e);
                }
                finally
                {
                    if ((null != connection) && (ConnectionState.Closed != connection.State))
                    {
                        connection.Close();
                        connection = null;
                    }
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:39,代码来源:LocalTransaction.cs

示例10: Rollback

    public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
    {
      // prevent commands in main thread to run concurrently
      Driver driver = connection.driver;
      lock (driver)
      {
        rollbackThreadId = Thread.CurrentThread.ManagedThreadId;
        while (connection.Reader != null)
        {
          // wait for reader to finish. Maybe we should not wait 
          // forever and cancel it after some time?
          System.Threading.Thread.Sleep(100);
        }
        simpleTransaction.Rollback();
        singlePhaseEnlistment.Aborted();
        DriverTransactionManager.RemoveDriverInTransaction(baseTransaction);

        if (connection.State == ConnectionState.Closed)
          connection.CloseFully();
        rollbackThreadId = 0;
      }
    }
开发者ID:BjkGkh,项目名称:R106,代码行数:22,代码来源:MySqlPromotableTransaction.cs

示例11: Rollback

 public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment) {}
开发者ID:npgsql,项目名称:npgsql,代码行数:1,代码来源:SystemTransactionTests.cs

示例12: SinglePhaseCommit

 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment) {}
开发者ID:npgsql,项目名称:npgsql,代码行数:1,代码来源:SystemTransactionTests.cs

示例13: SinglePhaseCommit

 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     _log.Debug("Single Phase Commit");
     if (_npgsqlTx != null)
     {
         _npgsqlTx.Commit();
         _npgsqlTx.Dispose();
         _npgsqlTx = null;
         singlePhaseEnlistment.Committed();
         _connection.PromotableLocalTransactionEnded();
     }
     else if (_callbacks != null)
     {
         if (_rm != null)
         {
             _rm.CommitWork(_callbacks.GetName());
             singlePhaseEnlistment.Committed();
         }
         else
         {
             _callbacks.CommitTransaction();
             singlePhaseEnlistment.Committed();
         }
         _callbacks = null;
     }
     _inTransaction = false;
 }
开发者ID:roji,项目名称:Npgsql,代码行数:27,代码来源:NpgsqlPromotableSinglePhaseNotification.cs

示例14: Rollback

		/// <summary>
		/// Rollbacks the specified single phase enlistment.
		/// </summary>
		/// <param name="singlePhaseEnlistment">The single phase enlistment.</param>
		public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
		{
			onTxComplete();
			try
			{
				session.Rollback(PromotableRavenClientEnlistment.GetLocalOrDistributedTransactionId(transaction));

				using (var machineStoreForApplication = IsolatedStorageFile.GetMachineStoreForDomain())
				{
					machineStoreForApplication.DeleteFile(TransactionRecoveryInformationFileName);
				}
			}
			catch (Exception e)
			{
				logger.ErrorException("Could not rollback distributed transaction", e);
				singlePhaseEnlistment.InDoubt(e);
				return;
			}
			singlePhaseEnlistment.Aborted();
		}
开发者ID:remcoros,项目名称:ravendb,代码行数:24,代码来源:RavenClientEnlistment.cs

示例15: Rollback

 public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     singlePhaseEnlistment.Done();
 }
开发者ID:areicher,项目名称:NServiceBus.RavenDB,代码行数:4,代码来源:FakePromotableResourceManager.cs


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