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


C# SinglePhaseEnlistment.Aborted方法代码示例

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


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

示例1: 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

示例2:

		void IPromotableSinglePhaseNotification.Rollback( SinglePhaseEnlistment singlePhaseEnlistment ) {
			this.simpleTransaction.Rollback();
			singlePhaseEnlistment.Aborted();
			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

示例3: SinglePhaseCommit

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

示例4: 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

示例5: catch

 ///<summary>
 /// Attempt to commit the internal transaction.
 ///</summary>
 void IPromotableSinglePhaseNotification.SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     try
     {
         // attempt to commit the enlistment
         this.dbTransaction.Commit();
         singlePhaseEnlistment.Committed();
     }
     catch (Exception e)
     {
         // something went wrong, make sure the transaction aborts
         singlePhaseEnlistment.Aborted(e);
         throw;
     }
     finally
     {
         // clean-up our resources
         Dispose();
     }
 }
开发者ID:JuRogn,项目名称:OA,代码行数:23,代码来源:AdoWorkBatchService.cs

示例6:

        /// <summary>
        /// Notifies this object that the transaction is being rolled back.
        /// </summary>
        /// <param name="singlePhaseEnlistment">
        /// Interfacet used to send a response to  the transaction manager.
        /// </param>
        void IPromotableSinglePhaseNotification.Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
        {
            m_dbTransaction.Rollback();
            singlePhaseEnlistment.Aborted();
            m_dbConnection.Enlistment = null;

            if (m_disposeConnection)
            {
                m_dbConnection.Dispose();
            }
        }
开发者ID:plusql,项目名称:hsqldb-snapshot-20160112,代码行数:17,代码来源:HsqlEnlistment.cs

示例7: Rollback

        public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
        {
			session.Rollback(PromotableRavenClientEnlistment.GetLocalOrDistributedTransactionId(transaction));
            singlePhaseEnlistment.Aborted();
        }
开发者ID:ajaishankar,项目名称:ravendb,代码行数:5,代码来源:RavenClientEnlistment.cs

示例8: SinglePhaseCommit

		public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
		{
			if (this.disposed)
			{
				return;
			}

			try
			{
				if (this.dataAccessObjectDataContext != null)
				{
					this.commandsContext = this.GetSqlTransactionalCommandsContext();

					this.dataAccessObjectDataContext.Commit(this.commandsContext, false);
					this.commandsContext.Commit();
				}

				singlePhaseEnlistment.Committed();
			}
			catch (Exception e)
			{
				ActionUtils.IgnoreExceptions(() => this.commandsContext.Rollback());

				singlePhaseEnlistment.Aborted(e);
			}
			finally
			{
				this.Dispose();
			}
		}
开发者ID:tumtumtum,项目名称:Shaolinq,代码行数:30,代码来源:TransactionContext.cs

示例9: Rollback

        public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
        {
            // we receive a commit message
            // if we own a local transaction, then commit that transaction
            if (_transaction != null)
            {
                _transaction.Rollback();
                _transaction = null;
            }
            else if (_transactionId > 0)
            {
                GetResourceManager().RollbackTransaction(_transactionId);
            }
            singlePhaseEnlistment.Aborted();

            _enlistedInTransactions.Remove(Transaction.Current);
        }
开发者ID:albumprinter,项目名称:Neo4jClient,代码行数:17,代码来源:TransactionSinglePhaseNotification.cs

示例10: SinglePhaseCommit

        public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
        {
            try
            {
                DataAccessModelTransactionManager.currentlyCommitingTransaction = this.Transaction;

                this.dataAccessObjectDataContext?.Commit(this, false);

                foreach (var persistenceTransactionContext in this.persistenceTransactionContextsBySqlDatabaseContexts.Values)
                {
                    persistenceTransactionContext.sqlDatabaseCommandsContext.Commit();
                }

                singlePhaseEnlistment.Committed();
            }
            catch (Exception e)
            {
                foreach (var persistenceTransactionContext in this.persistenceTransactionContextsBySqlDatabaseContexts.Values)
                {
                    try
                    {
                        persistenceTransactionContext.sqlDatabaseCommandsContext.Rollback();
                    }
                    catch
                    {
                    }
                }

                singlePhaseEnlistment.Aborted(e);
            }
            finally
            {
                DataAccessModelTransactionManager.currentlyCommitingTransaction = null;

                this.Dispose();
            }
        }
开发者ID:ciker,项目名称:Shaolinq,代码行数:37,代码来源:TransactionContext.cs

示例11: 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

示例12: 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));

				DeleteFile();
			}
			catch (Exception e)
			{
				logger.ErrorException("Could not rollback distributed transaction", e);
				singlePhaseEnlistment.InDoubt(e);
				return;
			}
			singlePhaseEnlistment.Aborted();
		}
开发者ID:samueldjack,项目名称:ravendb,代码行数:21,代码来源:RavenClientEnlistment.cs

示例13: Rollback

 public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Rollback");
     // try to rollback the transaction with either the
     // ADO.NET transaction or the callbacks that managed the
     // two phase commit transaction.
     if (_npgsqlTx != null)
     {
         _npgsqlTx.Rollback();
         _npgsqlTx.Dispose();
         _npgsqlTx = null;
         singlePhaseEnlistment.Aborted();
         _connection.PromotableLocalTransactionEnded();
     }
     else if (_callbacks != null)
     {
         if (_rm != null)
         {
             _rm.RollbackWork(_callbacks.GetName());
             singlePhaseEnlistment.Aborted();
         }
         else
         {
             _callbacks.RollbackTransaction();
             singlePhaseEnlistment.Aborted();
         }
         _callbacks = null;
     }
     _inTransaction = false;
 }
开发者ID:callixte,项目名称:Npgsql2,代码行数:30,代码来源:NpgsqlPromotableSinglePhaseNotification.cs

示例14: SinglePhaseCommit

        public void SinglePhaseCommit ( SinglePhaseEnlistment enlistment )
        {
            resource.NumSingle++;
            if ( resource.IgnoreSPC )
                return;

            if ( resource.FailSPC ) {
                if ( resource.FailWithException )
                    enlistment.Aborted ( new NotSupportedException () );
                else
                    enlistment.Aborted ();
            }
            else {
                resource.Commit ();
                enlistment.Committed ();
            }
        }
开发者ID:HarrievG,项目名称:mono,代码行数:17,代码来源:IntResourceManager.cs

示例15: Rollback

 // This method will be called if the RM should Rollback the
 // transaction.  Note that this method will be called even if
 // the transaction has been promoted to a distributed transaction.
 public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     Log.Info("InternalRM.Rollback");
     db.RollbackWork();
     singlePhaseEnlistment.Aborted();
 }
开发者ID:AlanLiu-AI,项目名称:Buzz,代码行数:9,代码来源:Client.cs


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