activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1423828 - in /activemq/trunk: activemq-broker/src/test/java/org/apache/activemq/store/PersistenceAdapterTestSupport.java activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
Date Wed, 19 Dec 2012 11:25:05 GMT
Author: gtully
Date: Wed Dec 19 11:25:04 2012
New Revision: 1423828

URL: http://svn.apache.org/viewvc?rev=1423828&view=rev
Log:
fix up test regression causing hang broker needs to be started and stopped for jdbc pa test

Modified:
    activemq/trunk/activemq-broker/src/test/java/org/apache/activemq/store/PersistenceAdapterTestSupport.java
    activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java

Modified: activemq/trunk/activemq-broker/src/test/java/org/apache/activemq/store/PersistenceAdapterTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/test/java/org/apache/activemq/store/PersistenceAdapterTestSupport.java?rev=1423828&r1=1423827&r2=1423828&view=diff
==============================================================================
--- activemq/trunk/activemq-broker/src/test/java/org/apache/activemq/store/PersistenceAdapterTestSupport.java
(original)
+++ activemq/trunk/activemq-broker/src/test/java/org/apache/activemq/store/PersistenceAdapterTestSupport.java
Wed Dec 19 11:25:04 2012
@@ -34,21 +34,22 @@ import org.apache.activemq.command.Messa
 abstract public class PersistenceAdapterTestSupport extends TestCase {
 
     protected PersistenceAdapter pa;
-    protected BrokerService brokerService = new BrokerService();
+    protected BrokerService brokerService;
 
     abstract protected PersistenceAdapter createPersistenceAdapter(boolean delete) throws
Exception;
 
     @Override
     protected void setUp() throws Exception {
+        brokerService = new BrokerService();
         pa = createPersistenceAdapter(true);
-        pa.start();
+        brokerService.setPersistenceAdapter(pa);
+        brokerService.start();
     }
     
     @Override
     protected void tearDown() throws Exception {
-        if( pa!=null ) {
-            pa.stop();
-            pa=null;
+        if (brokerService != null) {
+            brokerService.stop();
         }
     }
     

Modified: activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java?rev=1423828&r1=1423827&r2=1423828&view=diff
==============================================================================
--- activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
(original)
+++ activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
Wed Dec 19 11:25:04 2012
@@ -100,6 +100,11 @@ public class DefaultDatabaseLocker exten
                     // connections 
                     if (null != connection) {
                         try {
+                            connection.rollback();
+                        } catch (SQLException e1) {
+                            LOG.error("Caught exception during rollback on connection: "
+ e1, e1);
+                        }
+                        try {
                             connection.close();
                         } catch (SQLException e1) {
                             LOG.error("Caught exception while closing connection: " + e1,
e1);



Mime
View raw message