Apache.NMS.ActiveMQ.TransactionContext.InDoubt C# (CSharp) Method

InDoubt() public method

public InDoubt ( Enlistment enlistment ) : void
enlistment Enlistment
return void
        public void InDoubt(Enlistment enlistment)
        {
            try
            {
                dtcControlEvent.Reset();

                Tracer.Debug("In Doubt notification received for TX id: " + this.transactionId);

                BeforeEnd();

                // Now notify the broker that Rollback should be performed.
                TransactionInfo info = new TransactionInfo();
                info.ConnectionId = this.connection.ConnectionId;
                info.TransactionId = this.transactionId;
                info.Type = (int)TransactionType.End;

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

                info.Type = (int)TransactionType.Rollback;
                this.connection.CheckConnected();
                this.connection.SyncRequest(info);

                Tracer.Debug("InDoubt Transaction Rollback Done TX id: " + this.transactionId);

                RecoveryLogger.LogRecovered(this.transactionId as XATransactionId);

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

                AfterRollback();
            }
            finally
            {
                this.currentEnlistment = null;
                this.transactionId = null;

                CountDownLatch latch = this.recoveryComplete;
                if (latch != null)
                {
                    latch.countDown();
                }

                this.dtcControlEvent.Set();
            }
        }