activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1053657 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/TransactionContext.cs
Date Wed, 29 Dec 2010 15:58:45 GMT
Author: tabish
Date: Wed Dec 29 15:58:45 2010
New Revision: 1053657

URL: http://svn.apache.org/viewvc?rev=1053657&view=rev
Log:
Fix the InDoubt case to rollback the active transaction so that the next time a TX is started
the Messages will be delivered again.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/TransactionContext.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/TransactionContext.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/TransactionContext.cs?rev=1053657&r1=1053656&r2=1053657&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/TransactionContext.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/TransactionContext.cs
Wed Dec 29 15:58:45 2010
@@ -371,18 +371,30 @@ namespace Apache.NMS.ActiveMQ
 
         public void InDoubt(Enlistment enlistment)
         {
-            Tracer.Debug("In doubt notification received");
+            Tracer.Debug("In doubt notification received, Rolling Back TX");
+
+            // Now notify the broker that Rollback should be performed.
+            TransactionInfo info = new TransactionInfo();
+            info.ConnectionId = this.session.Connection.ConnectionId;
+            info.TransactionId = this.transactionId;
 
             try
             {
-                // Now notify the broker that it should forget this TX.
-                TransactionInfo info = new TransactionInfo();
-                info.ConnectionId = this.session.Connection.ConnectionId;
-                info.TransactionId = this.transactionId;
-                info.Type = (int) TransactionType.Forget;
-    
-                //Declare done on the enlistment
+                BeforeEnd();
+
+                info.Type = (int)TransactionType.End;
+                this.connection.SyncRequest(info);
+
+                info.Type = (int)TransactionType.Rollback;
+                this.connection.CheckConnected();
+                this.connection.SyncRequest(info);
+
+                Tracer.Debug("Transaction Rollback Reports Done: ");
+
+                // if server responds that nothing needs to be done, then reply done.
                 enlistment.Done();
+
+                AfterRollback();
             }
             finally
             {



Mime
View raw message