public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     singlePhaseEnlistment.Done();
 }
Beispiel #2
0
 ///<summary>
 /// Attempt to rollback the internal transaction.
 ///</summary>
 void IPromotableSinglePhaseNotification.Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     try
     {
         // attempt to rollback the transaction
         this.dbTransaction.Rollback();
         singlePhaseEnlistment.Done();
     }
     finally
     {
         // clean-up our resources
         Dispose();
     }
 }
 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     try
     {
         Commit();
         singlePhaseEnlistment.Done();
     }
     catch (Exception)
     {
         //on a callback thread, can't throw
     }
 }
 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     try
     {
         PerformActualCommit();
         singlePhaseEnlistment.Done();
     }
     catch (Exception e)
     {
         logger.Warn("Failed to commit enlistment " + Id, e);
         throw;
     }
     finally
     {
         onCompelete();
     }
 }
 public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
 {
     #if DEBUG
     System.Diagnostics.Trace.WriteLine("NuoDbTransaction::SinglePhaseCommit()");
     #endif
     Commit();
     singlePhaseEnlistment.Done();
 }
Beispiel #6
0
        public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
        {
            lock (this.syncObject)
            {
                try
                {
                    Tracer.Debug("Single Phase Commit notification received for TX id: " + this.transactionId);

                    if (this.transactionId != null)
                    {
                        BeforeEnd();

                        // Now notify the broker that a new XA'ish transaction has completed.
                        TransactionInfo info = new TransactionInfo();
                        info.ConnectionId = this.connection.ConnectionId;
                        info.TransactionId = this.transactionId;
                        info.Type = (int) TransactionType.CommitOnePhase;

                        this.connection.CheckConnected();
                        this.connection.SyncRequest(info);

                        Tracer.Debug("Transaction Single Phase Commit Done TX id: " + this.transactionId);

                        // if server responds that nothing needs to be done, then reply done.
                        enlistment.Done();

                        AfterCommit();
                    }
                }
                catch (Exception ex)
                {
                    Tracer.DebugFormat("Transaction[{0}] Single Phase Commit failed with error: {1}",
                                       this.transactionId, ex.Message);
                    AfterRollback();
                    enlistment.Done();
                    try
                    {
                        this.connection.OnException(ex);
                    }
                    catch (Exception error)
                    {
                        Tracer.Error(error.ToString());
                    }
                }
                finally
                {
                    this.currentEnlistment = null;
                    this.transactionId = null;
                    this.netTxState = TxState.None;

                    this.dtcControlEvent.Set();
                }
            }
        }