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


C# SinglePhaseEnlistment.InDoubt方法代碼示例

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


在下文中一共展示了SinglePhaseEnlistment.InDoubt方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

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

示例2: 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(transaction.LocalIdentifier);

				DeleteFile();
			}
			catch (Exception e)
			{
				logger.ErrorException("Could not rollback distributed transaction", e);
				singlePhaseEnlistment.InDoubt(e);
				return;
			}
			singlePhaseEnlistment.Aborted();
			ctx.Dispose();
		}
開發者ID:925coder,項目名稱:ravendb,代碼行數:22,代碼來源:RavenClientEnlistment.cs

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

示例4: SinglePhaseCommit

 public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
 {
     SqlInternalConnection validConnection = this.GetValidConnection();
     SqlConnection connection = validConnection.Connection;
     Bid.Trace("<sc.SqlDelegatedTransaction.SinglePhaseCommit|RES|CPOOL> %d#, Connection %d#, committing transaction.\n", this.ObjectID, validConnection.ObjectID);
     RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
         if (validConnection.IsConnectionDoomed)
         {
             lock (validConnection)
             {
                 this._active = false;
                 this._connection = null;
             }
             enlistment.Aborted(SQL.ConnectionDoomed());
         }
         else
         {
             Exception exception;
             lock (validConnection)
             {
                 try
                 {
                     this.ValidateActiveOnConnection(validConnection);
                     this._active = false;
                     this._connection = null;
                     validConnection.ExecuteTransaction(SqlInternalConnection.TransactionRequest.Commit, null, System.Data.IsolationLevel.Unspecified, this._internalTransaction, true);
                     exception = null;
                 }
                 catch (SqlException exception3)
                 {
                     exception = exception3;
                     ADP.TraceExceptionWithoutRethrow(exception3);
                     validConnection.DoomThisConnection();
                 }
                 catch (InvalidOperationException exception2)
                 {
                     exception = exception2;
                     ADP.TraceExceptionWithoutRethrow(exception2);
                     validConnection.DoomThisConnection();
                 }
             }
             if (exception != null)
             {
                 if (this._internalTransaction.IsCommitted)
                 {
                     enlistment.Committed();
                 }
                 else if (this._internalTransaction.IsAborted)
                 {
                     enlistment.Aborted(exception);
                 }
                 else
                 {
                     enlistment.InDoubt(exception);
                 }
             }
             validConnection.CleanupConnectionOnTransactionCompletion(this._atomicTransaction);
             if (exception == null)
             {
                 enlistment.Committed();
             }
         }
     }
     catch (OutOfMemoryException exception6)
     {
         connection.Abort(exception6);
         throw;
     }
     catch (StackOverflowException exception5)
     {
         connection.Abort(exception5);
         throw;
     }
     catch (ThreadAbortException exception4)
     {
         connection.Abort(exception4);
         throw;
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:81,代碼來源:SqlDelegatedTransaction.cs


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