diff --git a/jOOQ-test/src/test/java/org/jooq/test/_/testcases/BenchmarkTests.java b/jOOQ-test/src/test/java/org/jooq/test/_/testcases/BenchmarkTests.java index 1d6be552c4..c183a56c9c 100644 --- a/jOOQ-test/src/test/java/org/jooq/test/_/testcases/BenchmarkTests.java +++ b/jOOQ-test/src/test/java/org/jooq/test/_/testcases/BenchmarkTests.java @@ -192,24 +192,35 @@ extends BaseTest q = null; + + try { + // System.out.println("Start"); // System.in.read(); // System.in.read(); - ResultQuery q = create - .select() - .from("t_book") - .where("id = ?", -1) - .keepStatement(true); - StopWatch watch = new StopWatch(); - for (int i = 0; i < REPETITIONS_PLAIN_SQL; i++) { - q.bind(1, i % 4 + 1).fetchOne(); - } + q = create + .select() + .from("t_book") + .where("id = ?", -1) + .keepStatement(true); + + StopWatch watch = new StopWatch(); + for (int i = 0; i < REPETITIONS_PLAIN_SQL; i++) { + q.bind(1, i % 4 + 1).fetchOne(); + } + + watch.splitInfo("Done with " + REPETITIONS_PLAIN_SQL + " repetitions"); - watch.splitInfo("Done with " + REPETITIONS_PLAIN_SQL + " repetitions"); // System.out.println("Stop"); // System.in.read(); // System.in.read(); + } + finally { + if (q != null) + q.close(); + } } private void testBenchmarkReuseSQLString(DSLContext create, int repetitions) throws Exception {