activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-4643 - update to jdbc checkpoint to validate connection before declaring success, is more bullit proof in preventing an early restart even if start is now deferred till after stop completes
Date Tue, 03 Sep 2013 15:35:26 GMT
Updated Branches:
  refs/heads/trunk 29453d679 -> b588d6cb9


https://issues.apache.org/jira/browse/AMQ-4643 - update to jdbc checkpoint to validate connection
before declaring success, is more bullit proof in preventing an early restart even if start
is now deferred till after stop completes


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/b588d6cb
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/b588d6cb
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/b588d6cb

Branch: refs/heads/trunk
Commit: b588d6cb9b3503343f9426caa6aa765d0cc1f83c
Parents: 29453d6
Author: gtully <gary.tully@gmail.com>
Authored: Tue Sep 3 16:34:25 2013 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Sep 3 16:35:08 2013 +0100

----------------------------------------------------------------------
 .../org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java   | 3 +++
 .../test/java/org/apache/activemq/store/jdbc/JDBCTestMemory.java | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/b588d6cb/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
----------------------------------------------------------------------
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 0c12087..7ff4ae0 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);

http://git-wip-us.apache.org/repos/asf/activemq/blob/b588d6cb/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCTestMemory.java
----------------------------------------------------------------------
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 6699d33..e8bda07 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);


Mime
View raw message