You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ck...@apache.org on 2018/01/09 12:12:44 UTC

svn commit: r1820649 - /jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java

Author: ckoell
Date: Tue Jan  9 12:12:44 2018
New Revision: 1820649

URL: http://svn.apache.org/viewvc?rev=1820649&view=rev
Log:
Debug Log

Modified:
    jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java

Modified: jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java?rev=1820649&r1=1820648&r2=1820649&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java (original)
+++ jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelper.java Tue Jan  9 12:12:44 2018
@@ -301,6 +301,7 @@ public class ConnectionHelper {
         Connection con = null;
         Statement stmt = null;
         boolean inBatchMode = inBatchMode();
+        long start = System.currentTimeMillis();
         try {
             con = getConnection(inBatchMode);
             if (params == null || params.length == 0) {
@@ -313,6 +314,8 @@ public class ConnectionHelper {
             }
         } finally {
             closeResources(con, stmt, null, inBatchMode);
+            long duration = System.currentTimeMillis() - start;
+            log.debug("SQL-Execution [{}] took [{}] ms.", sql, duration);
         }
     }
 
@@ -339,12 +342,14 @@ public class ConnectionHelper {
         Connection con = null;
         PreparedStatement stmt = null;
         boolean inBatchMode = inBatchMode();
+        long start = System.currentTimeMillis();
         try {
             con = getConnection(inBatchMode);
             stmt = con.prepareStatement(sql);
             return execute(stmt, params).getUpdateCount();
         } finally {
             closeResources(con, stmt, null, inBatchMode);
+            log.debug("SQL-Execution [{}] took [{}] ms.", sql, (System.currentTimeMillis() - start) );
         }
     }
 
@@ -389,6 +394,7 @@ public class ConnectionHelper {
         PreparedStatement stmt = null;
         ResultSet rs = null;
         boolean inBatchMode = inBatchMode();
+        long start = System.currentTimeMillis();
         try {
             con = getConnection(inBatchMode);
             if (returnGeneratedKeys) {
@@ -421,6 +427,8 @@ public class ConnectionHelper {
         } catch (SQLException e) {
             closeResources(con, stmt, rs, inBatchMode);
             throw e;
+        } finally {
+            log.debug("SQL-Execution [{}] took [{}] ms.", sql, (System.currentTimeMillis() - start) );
         }
     }