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


C# Transactions.Enlistment類代碼示例

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


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

示例1: Commit

 public void Commit(Enlistment enlistment)
 {
     try
     {
         assertNotDisposed();
         logger.DebugFormat("Committing enlistment with id: {0}", Id);
         queueStorage.Global(actions =>
         {
             actions.RemoveReversalsMoveCompletedMessagesAndFinishSubQueueMove(Id);
             actions.MarkAsReadyToSend(Id);
             actions.DeleteRecoveryInformation(Id);
             actions.Commit();
         });
         enlistment.Done();
         logger.DebugFormat("Commited enlistment with id: {0}", Id);
     }
     catch (Exception e)
     {
         logger.Warn("Failed to commit enlistment " + Id, e);
         throw;
     }
     finally
     {
         onCompelete();
     }
 }
開發者ID:endeavour,項目名稱:rhino-tools,代碼行數:26,代碼來源:TransactionEnlistment.cs

示例2: Rollback

 public void Rollback(Enlistment enlistment)
 {
     container.Rollback();
     container.Ext().Refresh(oldItem, int.MaxValue);
     oldItem = null;
     container = null;
 }
開發者ID:JoeyCyril,項目名稱:BoC,代碼行數:7,代碼來源:Db4oEnlist.cs

示例3: Commit

			public void Commit(Enlistment enlistment)
			{
				if (_ThrowIt)
					Assert.Fail("commit is never called if prepare failed");

				enlistment.Done();
			}
開發者ID:hammett,項目名稱:Castle.Transactions,代碼行數:7,代碼來源:WhoStoleMyTransaction_TestCase.cs

示例4: InDoubt

 public void InDoubt(Enlistment enlistment)
 {
     log.Warn("transaction in doubt {0}, messages {1}", TransactionId, this.Messages.Count);
     if (_onrollback != null) _onrollback(this);
     enlistment.Done();
     TransactionOpen = false;
 }
開發者ID:BrettBailey,項目名稱:nginn-messagebus,代碼行數:7,代碼來源:MessageBatchingRM.cs

示例5: Commit

		public void Commit(Enlistment enlistment)
		{
			if (_transaction != null && !_transaction.IsUpdated)
			{
				_transaction.Commit();
				_transaction = null;

				if (Completed != null)
				{
					Completed(this, new EventArgs());
				}

				if (_connection != null)
				{
					if (!_connection.Options.Pooling && (_connection.OwningConnection == null || _connection.OwningConnection.IsClosed))
					{
						_connection.Disconnect();
					}
				}
				_connection = null;
				_systemTransaction = null;

				// Declare done on the enlistment
				enlistment.Done();
			}
		}
開發者ID:nakagami,項目名稱:FirebirdSql.Data.FirebirdClient,代碼行數:26,代碼來源:FbEnlistmentNotification.cs

示例6: StringBuilder

 void IEnlistmentNotification.Commit(Enlistment enlistment)
 {
     this.m_Value = new StringBuilder(this.m_TemporaryValue.ToString());
     this.m_TemporaryValue = null;
     this.enlistedTransaction = null;
     enlistment.Done();
 }
開發者ID:nickchal,項目名稱:pash,代碼行數:7,代碼來源:TransactedString.cs

示例7: Commit

 /// <summary>
 /// Performs necessary commit actions, clearing the current <see cref="TransactionContext"/>
 /// </summary>
 public void Commit(Enlistment enlistment)
 {
     BeforeCommit();
     DoCommit();
     TransactionContext.Clear();
     enlistment.Done();
 }
開發者ID:plillevold,項目名稱:Rebus,代碼行數:10,代碼來源:AmbientTransactionContext.cs

示例8: Commit

        public void Commit(Enlistment enlistment)
        {
            if (this.transaction != null && !this.transaction.IsUpdated)
            {
                this.transaction.Commit();
                this.transaction = null;

                if (this.Completed != null)
                {
                    this.Completed(this, new EventArgs());
                }

                if (this.connection != null)
                {
                    if (!this.connection.Pooled && (this.connection.OwningConnection == null || this.connection.OwningConnection.IsClosed))
                    {
                        this.connection.Disconnect();
                    }
                }
                this.connection         = null;
                this.systemTransaction  = null;

                // Declare done on the enlistment
                enlistment.Done();
            }
        }
開發者ID:antgraf,項目名稱:Embedded-DB-.Net-Performance-Test,代碼行數:26,代碼來源:FbEnlistmentNotification.cs

示例9: Commit

		public override void Commit(Enlistment enlistment)
		{
			if (_ThrowOnCommit)
				throw new Exception("Simulated commit error");

			base.Commit(enlistment);
		}
開發者ID:bittercoder,項目名稱:Windsor,代碼行數:7,代碼來源:ThrowsExceptionResource.cs

示例10: Commit

 public void Commit(Enlistment enlistment)
 {
     log.Debug("Commit {0}, Messages: {1}", TransactionId, Messages.Count);
     if (_oncommit != null) _oncommit(this);
     enlistment.Done();
     TransactionOpen = false;
 }
開發者ID:BrettBailey,項目名稱:nginn-messagebus,代碼行數:7,代碼來源:MessageBatchingRM.cs

示例11: Rollback

 public void Rollback(Enlistment enlistment)
 {
     enlistment.Done();
     this.notification.Aborted(0, false, 0, 0);
     Marshal.ReleaseComObject(this.notification);
     this.notification = null;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:VoterBallot.cs

示例12: StringBuilder

 /// <summary>
 /// Make the transacted changes permanent.
 /// </summary>
 void IEnlistmentNotification.Commit(Enlistment enlistment)
 {
     _value = new StringBuilder(_temporaryValue.ToString());
     _temporaryValue = null;
     _enlistedTransaction = null;
     enlistment.Done();
 }
開發者ID:40a,項目名稱:PowerShell,代碼行數:10,代碼來源:TransactedString.cs

示例13: InDoubt

 public void InDoubt(Enlistment enlistment)
 {
     enlistment.Done();
     this.notification.InDoubt();
     Marshal.ReleaseComObject(this.notification);
     this.notification = null;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:VoterBallot.cs

示例14: Commit

 public void Commit(Enlistment enlistment)
 {
     enlistment.Done();
     this.notification.Committed(false, 0, 0);
     Marshal.ReleaseComObject(this.notification);
     this.notification = null;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:VoterBallot.cs

示例15: ApplicationException

		void IEnlistmentNotification.Commit(Enlistment enlistment)
		{
			if (_ThrowIt && ++_ErrorCount < 2)
				throw new ApplicationException("simulating resource failure");

			enlistment.Done();
		}
開發者ID:carcer,項目名稱:Castle.Facilities.NHibernate,代碼行數:7,代碼來源:ThrowingResource.cs


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