git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@747391 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2009-02-24 14:18:29 +00:00
parent 9d9d4cd69d
commit 0a5ae2b68e
1 changed files with 11 additions and 3 deletions

View File

@ -95,7 +95,11 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
} }
LOG.debug("Sleeping for " + lockAcquireSleepInterval + " milli(s) before trying again to get the lock..."); 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); LOG.info("Becoming the master on dataSource: " + dataSource);
@ -103,8 +107,12 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
public void stop() throws Exception { public void stop() throws Exception {
stopping = true; stopping = true;
if (connection != null) { if (connection != null && !connection.isClosed()) {
connection.rollback(); try {
connection.rollback();
} catch (SQLException sqle) {
LOG.warn("Exception while rollbacking the connection on shutdown", sqle);
}
connection.close(); connection.close();
} }
} }