mirror of https://github.com/apache/activemq.git
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:
parent
ba477931a7
commit
d948c179da
|
@ -61,12 +61,14 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
|
||||||
stopping = false;
|
stopping = false;
|
||||||
|
|
||||||
LOG.info("Attempting to acquire the exclusive lock to become the Master broker");
|
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;
|
PreparedStatement statement = null;
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
connection = dataSource.getConnection();
|
connection = dataSource.getConnection();
|
||||||
connection.setAutoCommit(false);
|
connection.setAutoCommit(false);
|
||||||
String sql = statements.getLockCreateStatement();
|
|
||||||
statement = connection.prepareStatement(sql);
|
statement = connection.prepareStatement(sql);
|
||||||
statement.execute();
|
statement.execute();
|
||||||
break;
|
break;
|
||||||
|
@ -91,7 +93,7 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOG.error("Failed to acquire lock: " + e, e);
|
LOG.debug("Lock failure: "+ e, e);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
// Let's make sure the database connection is properly
|
// Let's make sure the database connection is properly
|
||||||
|
@ -112,13 +114,13 @@ public class DefaultDatabaseLocker implements DatabaseLocker {
|
||||||
try {
|
try {
|
||||||
statement.close();
|
statement.close();
|
||||||
} catch (SQLException e1) {
|
} catch (SQLException e1) {
|
||||||
LOG.warn("Caught while closing statement: " + e1, e1);
|
LOG.debug("Caught while closing statement: " + e1, e1);
|
||||||
}
|
}
|
||||||
statement = null;
|
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 {
|
try {
|
||||||
Thread.sleep(lockAcquireSleepInterval);
|
Thread.sleep(lockAcquireSleepInterval);
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
|
|
Loading…
Reference in New Issue