cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1004376 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne: access/DataNode.java access/QueryLogger.java log/CommonsJdbcEventLogger.java log/JdbcEventLogger.java
Date Mon, 04 Oct 2010 19:31:21 GMT
Author: aadamchik
Date: Mon Oct  4 19:31:21 2010
New Revision: 1004376

URL: http://svn.apache.org/viewvc?rev=1004376&view=rev
Log:
CAY-1486 Switch QueryLogger to a DI-managed object

* removing 'logQueryStart' from the API. IMO this just adds verbosity to the log for
  no good reason. Transaction start/end demarcates individual query batches and should
  be sufficient

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryLogger.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java?rev=1004376&r1=1004375&r2=1004376&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java
Mon Oct  4 19:31:21 2010
@@ -219,8 +219,6 @@ public class DataNode implements QueryEn
                             + listSize);
         }
 
-        QueryLogger.logQueryStart(listSize);
-
         // do this meaningless inexpensive operation to trigger AutoAdapter lazy
         // initialization before opening a connection. Otherwise we may end up with two
         // connections open simultaneously, possibly hitting connection pool upper limit.

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryLogger.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryLogger.java?rev=1004376&r1=1004375&r2=1004376&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryLogger.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryLogger.java
Mon Oct  4 19:31:21 2010
@@ -302,7 +302,12 @@ public class QueryLogger {
      * @since 1.2
      */
     public static void logQueryStart(int count) {
-        logger.logQueryStart(count);
+        if (isLoggable()) {
+            String countStr = (count == 1) ? "--- will run 1 query." : "--- will run "
+                    + count
+                    + " queries.";
+            logger.log(countStr);
+        }
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java?rev=1004376&r1=1004375&r2=1004376&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
Mon Oct  4 19:31:21 2010
@@ -376,15 +376,6 @@ public class CommonsJdbcEventLogger impl
         }
     }
 
-    public void logQueryStart(int count) {
-        if (isLoggable()) {
-            String countStr = (count == 1) ? "--- will run 1 query." : "--- will run "
-                    + count
-                    + " queries.";
-            logger.info(countStr);
-        }
-    }
-
     public boolean isLoggable() {
         return logger.isInfoEnabled();
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java?rev=1004376&r1=1004375&r2=1004376&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java
Mon Oct  4 19:31:21 2010
@@ -75,8 +75,6 @@ public interface JdbcEventLogger {
 
     void logQueryError(Throwable th);
 
-    void logQueryStart(int count);
-
     /**
      * Returns true if current thread default log level is high enough to generate output.
      */



Mime
View raw message