From baa10ed33e870cacf4eabcfc4167887c89b7a0d1 Mon Sep 17 00:00:00 2001 From: gtully Date: Wed, 20 May 2015 09:53:32 +0100 Subject: [PATCH] more derby shutdown woes resolved --- .../apache/activemq/store/jdbc/DataSourceServiceSupport.java | 4 ---- .../activemq/store/jdbc/JDBCNetworkBrokerDetachTest.java | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DataSourceServiceSupport.java b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DataSourceServiceSupport.java index e36a66b169..9790d3d8c6 100644 --- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DataSourceServiceSupport.java +++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/DataSourceServiceSupport.java @@ -98,10 +98,6 @@ abstract public class DataSourceServiceSupport extends LockableServiceSupport { final EmbeddedDataSource ds = new EmbeddedDataSource(); ds.setDatabaseName("derbydb"); ds.setCreateDatabase("create"); - try { - ds.getConnection().close(); - } catch (SQLException ignored) { - } return ds; } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCNetworkBrokerDetachTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCNetworkBrokerDetachTest.java index 514dd4a540..4881b2f252 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCNetworkBrokerDetachTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCNetworkBrokerDetachTest.java @@ -26,6 +26,7 @@ public class JDBCNetworkBrokerDetachTest extends NetworkBrokerDetachTest { JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter(); EmbeddedDataSource dataSource = (EmbeddedDataSource) jdbc.getDataSource(); dataSource.setDatabaseName(broker.getBrokerName()); + dataSource.getConnection().close(); // ensure derby for brokerName is initialized broker.setPersistenceAdapter(jdbc); broker.setUseVirtualTopics(false); }