Exemple #1
0
        private static void HandleEndPrepare(IAsyncResult result)
        {
            PreparingEnlistment asyncState = (PreparingEnlistment)result.AsyncState;
            bool flag = false;

            try
            {
                if (!result.CompletedSynchronously)
                {
                    PrepareAsyncResult.End(result);
                    asyncState.Prepared();
                }
                flag = true;
            }
            catch (TransactionException)
            {
            }
            finally
            {
                if (!flag)
                {
                    asyncState.ForceRollback();
                }
            }
        }
Exemple #2
0
        void IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment)
        {
            bool flag = false;

            try
            {
                IAsyncResult result = new PrepareAsyncResult(this, handleEndPrepare, preparingEnlistment);
                if (result.CompletedSynchronously)
                {
                    PrepareAsyncResult.End(result);
                    preparingEnlistment.Prepared();
                }
                flag = true;
            }
            catch (TransactionException)
            {
            }
            finally
            {
                if (!flag)
                {
                    preparingEnlistment.ForceRollback();
                }
            }
        }
 void IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment)
 {
     bool success = false;
     try
     {
         IAsyncResult result = new PrepareAsyncResult(this, TransactionContext.handleEndPrepare, preparingEnlistment);
         if (result.CompletedSynchronously)
         {
             PrepareAsyncResult.End(result);
             preparingEnlistment.Prepared();
         }
         success = true;
     }
     //we need to swollow the TransactionException as it could because another party aborting it
     catch (TransactionException) 
     {
     }
     finally
     {
         if (!success)
         {
             preparingEnlistment.ForceRollback();
         }
     }
 }
Exemple #4
0
        void IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment)
        {
            bool success = false;

            try
            {
                IAsyncResult result = new PrepareAsyncResult(this, TransactionContext.handleEndPrepare, preparingEnlistment);
                if (result.CompletedSynchronously)
                {
                    PrepareAsyncResult.End(result);
                    preparingEnlistment.Prepared();
                }
                success = true;
            }
            //we need to swollow the TransactionException as it could because another party aborting it
            catch (TransactionException)
            {
            }
            finally
            {
                if (!success)
                {
                    preparingEnlistment.ForceRollback();
                }
            }
        }
Exemple #5
0
        static void HandleEndPrepare(IAsyncResult result)
        {
            PreparingEnlistment preparingEnlistment = (PreparingEnlistment)result.AsyncState;
            bool success = false;

            try
            {
                if (!result.CompletedSynchronously)
                {
                    PrepareAsyncResult.End(result);
                    preparingEnlistment.Prepared();
                }
                success = true;
            }
            //we need to swollow the TransactionException as it could because another party aborting it
            catch (TransactionException)
            {
            }
            finally
            {
                if (!success)
                {
                    preparingEnlistment.ForceRollback();
                }
            }
        }
Exemple #6
0
            static bool OnEndPersist(IAsyncResult result)
            {
                PrepareAsyncResult thisPtr = (PrepareAsyncResult)result.AsyncState;

                thisPtr.context.durableInstance.EndPersist(result);
                thisPtr.context.durableInstance.OnTransactionPrepared();
                return(true);
            }
 void IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment)
 {
     bool flag = false;
     try
     {
         IAsyncResult result = new PrepareAsyncResult(this, handleEndPrepare, preparingEnlistment);
         if (result.CompletedSynchronously)
         {
             PrepareAsyncResult.End(result);
             preparingEnlistment.Prepared();
         }
         flag = true;
     }
     catch (TransactionException)
     {
     }
     finally
     {
         if (!flag)
         {
             preparingEnlistment.ForceRollback();
         }
     }
 }