activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r747391 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
Date Tue, 24 Feb 2009 14:18:29 GMT
Author: dejanb
Date: Tue Feb 24 14:18:29 2009
New Revision: 747391

URL: http://svn.apache.org/viewvc?rev=747391&view=rev
Log:
additional fix for https://issues.apache.org/activemq/browse/AMQ-2074

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java?rev=747391&r1=747390&r2=747391&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
Tue Feb 24 14:18:29 2009
@@ -95,7 +95,11 @@
             }
 
             LOG.debug("Sleeping for " + lockAcquireSleepInterval + " milli(s) before trying
again to get the lock...");
-            Thread.sleep(lockAcquireSleepInterval);
+            try {
+            	Thread.sleep(lockAcquireSleepInterval);
+            } catch (InterruptedException ie) {
+            	LOG.warn("Master lock retry sleep interrupted", ie);
+            }
         }
 
         LOG.info("Becoming the master on dataSource: " + dataSource);
@@ -103,8 +107,12 @@
 
     public void stop() throws Exception {
         stopping = true;
-        if (connection != null) {
-            connection.rollback();
+        if (connection != null && !connection.isClosed()) {
+        	try {
+        		connection.rollback();
+        	} catch (SQLException sqle) {
+        		LOG.warn("Exception while rollbacking the connection on shutdown", sqle);
+        	}
             connection.close();
         }
     }



Mime
View raw message