activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r525306 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.cpp
Date Tue, 03 Apr 2007 22:13:53 GMT
Author: tabish
Date: Tue Apr  3 15:13:52 2007
New Revision: 525306

URL: http://svn.apache.org/viewvc?view=rev&rev=525306
Log:
http://issues.apache.org/activemq/browse/AMQCPP-83

Transaction should stop and start the session on a commit or rollback to ensure that all messages
are processed, redelivery should be to the session not the consumers.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.cpp?view=diff&rev=525306&r1=525305&r2=525306
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQTransaction.cpp
Tue Apr  3 15:13:52 2007
@@ -214,6 +214,9 @@
                 "Commit called before transaction was started.");
         }
 
+        // Stop any deliveries
+        session->stop();
+
         // Commit the current Transaction
         connection->getConnectionData()->getConnector()->
             commit( transactionInfo, session->getSessionInfo() );
@@ -224,6 +227,9 @@
         // Start a new Transaction
         transactionInfo = connection->getConnectionData()->
             getConnector()->startTransaction( session->getSessionInfo() );
+
+        // Stop any deliveries
+        session->start();
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
@@ -242,6 +248,9 @@
                 "Rollback called before transaction was started.");
         }
 
+        // Stop any Deliveries
+        session->stop();
+
         // Rollback the Transaction
         connection->getConnectionData()->getConnector()->
             rollback( transactionInfo, session->getSessionInfo() );
@@ -283,6 +292,9 @@
             // to the rollback tasks.
             rollbackMap.clear();
         }
+
+        // Start Deliveries
+        session->start();
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
@@ -363,7 +375,7 @@
             }
 
             DispatchData data( consumer->getConsumerInfo(), message );
-            consumer->dispatch( data );
+            session->dispatch( data );
         }
     }
     AMQ_CATCH_RETHROW( ActiveMQException )



Mime
View raw message