Was part of AMQ-2414: reduce verbosity of expection traces in the console.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@818923 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2009-09-25 17:35:30 +00:00
parent ba477931a7
commit d948c179da
1 changed files with 6 additions and 4 deletions

View File

@ -61,12 +61,14 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
stopping = false;
LOG.info("Attempting to acquire the exclusive lock to become the Master broker");
String sql = statements.getLockCreateStatement();
LOG.debug("Locking Query is "+sql);
PreparedStatement statement = null;
while (true) {
try {
connection = dataSource.getConnection();
connection.setAutoCommit(false);
String sql = statements.getLockCreateStatement();
statement = connection.prepareStatement(sql);
statement.execute();
break;
@ -91,7 +93,7 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
}
} else {
LOG.error("Failed to acquire lock: " + e, e);
LOG.debug("Lock failure: "+ e, e);
}
} finally {
// Let's make sure the database connection is properly
@ -112,13 +114,13 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
try {
statement.close();
} catch (SQLException e1) {
LOG.warn("Caught while closing statement: " + e1, e1);
LOG.debug("Caught while closing statement: " + e1, e1);
}
statement = null;
}
}
LOG.debug("Sleeping for " + lockAcquireSleepInterval + " milli(s) before trying again to get the lock...");
LOG.info("Failed to acquire lock. Sleeping for " + lockAcquireSleepInterval + " milli(s) before trying again...");
try {
Thread.sleep(lockAcquireSleepInterval);
} catch (InterruptedException ie) {