activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r818923 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DefaultDatabaseLocker.java
Date Fri, 25 Sep 2009 17:35:30 GMT
Author: chirino
Date: Fri Sep 25 17:35:30 2009
New Revision: 818923

URL: http://svn.apache.org/viewvc?rev=818923&view=rev
Log:
Was part of AMQ-2414: reduce verbosity of expection traces in the console.

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=818923&r1=818922&r2=818923&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
Fri Sep 25 17:35:30 2009
@@ -61,12 +61,14 @@
         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 @@
                         }
 
                     } 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 @@
                     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) {



Mime
View raw message