diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java index 0c12087d2c..7ff4ae0267 100755 --- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java +++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java @@ -665,6 +665,9 @@ public class JDBCPersistenceAdapter extends DataSourceServiceSupport implements Connection connection = null; try { connection = getDataSource().getConnection(); + if (!connection.isValid(10)) { + throw new IOException("isValid(10) failed for: " + connection); + } } catch (SQLException e) { LOG.debug("Could not get JDBC connection for checkpoint: " + e); throw IOExceptionSupport.create(e); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCTestMemory.java b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCTestMemory.java index 6699d3375c..e8bda0786c 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCTestMemory.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCTestMemory.java @@ -27,6 +27,7 @@ import junit.framework.TestCase; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.broker.BrokerService; import org.apache.derby.jdbc.EmbeddedDataSource; +import org.junit.Ignore; public class JDBCTestMemory extends TestCase { @@ -82,7 +83,8 @@ public class JDBCTestMemory extends TestCase { sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); dest = sess.createQueue("test"); } - + + @Ignore("requires human input to terminate!") public void testRecovery() throws Exception { init(); MessageProducer producer = sess.createProducer(dest);