From c0ede89351958fba8c5112fd4c8fbf0fc17e8e12 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sun, 12 Oct 2014 18:16:38 +0200 Subject: Check whether database connection is still open. Note, however, that a real check needs to use .isValid() which is only available starting from JDBC4. So, we need to move up to this. --- org/madore/damlengine/WeblogDatabaseConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'org/madore/damlengine/WeblogDatabaseConnection.java') diff --git a/org/madore/damlengine/WeblogDatabaseConnection.java b/org/madore/damlengine/WeblogDatabaseConnection.java index 16d0973..dfacebb 100644 --- a/org/madore/damlengine/WeblogDatabaseConnection.java +++ b/org/madore/damlengine/WeblogDatabaseConnection.java @@ -21,7 +21,7 @@ public final class WeblogDatabaseConnection { public static Connection getConnection() throws SQLException { Connection conn = pconn.get(); - if ( conn == null ) { + if ( conn == null || conn.isClosed() ) { String dbHost = null; if ( ! DamlEngine.runAsServlet ) dbHost = System.getenv("DAMLENGINE_PGHOST"); -- cgit v1.2.3