Repository: cayenne Updated Branches: refs/heads/master 78efdc3f9 -> 16ddfc6ba
Log query before PreparedStatement is compiled Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/16ddfc6b Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/16ddfc6b Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/16ddfc6b Branch: refs/heads/master Commit: 16ddfc6ba5805f8505ad3cd9a110c49b1e22cb89 Parents: 78efdc3 Author: Nikita Timofeev <stari...@gmail.com> Authored: Fri May 19 10:40:45 2017 +0300 Committer: Nikita Timofeev <stari...@gmail.com> Committed: Fri May 19 10:40:45 2017 +0300 ---------------------------------------------------------------------- .../main/java/org/apache/cayenne/access/jdbc/SelectAction.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne/blob/16ddfc6b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java index 8001067..e7ae4c8 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java @@ -91,6 +91,9 @@ public class SelectAction extends BaseSQLAction { final String sql = translator.getSql(); DbAttributeBinding[] bindings = translator.getBindings(); + + logger.logQuery(sql, bindings, System.currentTimeMillis() - t1); + PreparedStatement statement = connection.prepareStatement(sql); bind(dataNode.getAdapter(), statement, bindings); @@ -99,8 +102,6 @@ public class SelectAction extends BaseSQLAction { statement.setFetchSize(fetchSize); } - logger.logQuery(sql, bindings, System.currentTimeMillis() - t1); - ResultSet rs; // need to run in try-catch block to close statement properly if