From abb0b2aaf4ee5e6f147987401c9b059e5a7679d2 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 9 Jun 2013 23:51:39 +0200 Subject: wip --- src/main/java/io/trygvis/async/SqlEffectExecutor.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/main/java/io/trygvis/async/SqlEffectExecutor.java') diff --git a/src/main/java/io/trygvis/async/SqlEffectExecutor.java b/src/main/java/io/trygvis/async/SqlEffectExecutor.java index 51ad31d..3da2cd3 100644 --- a/src/main/java/io/trygvis/async/SqlEffectExecutor.java +++ b/src/main/java/io/trygvis/async/SqlEffectExecutor.java @@ -15,11 +15,11 @@ public class SqlEffectExecutor { } public A transaction(SqlEffect effect) throws SQLException { - int pid; +// int pid; try (Connection c = dataSource.getConnection()) { - pid = getPid(c); - System.out.println("pid = " + pid); +// pid = getPid(c); +// System.out.println("pid = " + pid); boolean ok = false; try { @@ -28,7 +28,7 @@ public class SqlEffectExecutor { ok = true; return a; } finally { - System.out.println("Closing, pid = " + pid); +// System.out.println("Closing, pid = " + pid); if (!ok) { try { c.rollback(); @@ -49,14 +49,4 @@ public class SqlEffectExecutor { } }); } - - private int getPid(Connection c) throws SQLException { - int pid; - try (Statement statement = c.createStatement()) { - ResultSet rs = statement.executeQuery("SELECT pg_backend_pid()"); - rs.next(); - pid = rs.getInt(1); - } - return pid; - } } -- cgit v1.2.3