summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2014-10-12 16:46:56 (GMT)
committerDavid A. Madore <david+git@madore.org>2014-10-12 16:46:56 (GMT)
commitaf3d007e78246144f2f50aaadc05f81bae000f84 (patch)
tree7e6f71d0e3b97b39b54d731860d3c260494f34f3
parentc0ede89351958fba8c5112fd4c8fbf0fc17e8e12 (diff)
downloaddamlengine-af3d007e78246144f2f50aaadc05f81bae000f84.zip
damlengine-af3d007e78246144f2f50aaadc05f81bae000f84.tar.gz
damlengine-af3d007e78246144f2f50aaadc05f81bae000f84.tar.bz2
Use JDBC4, in order to use the .isValid() method.
Note that the PostgreSQL implementation does not have this in the 9.1-901 version. Try 9.2-1002 instead (sucks: this is not in Debian stable...).
-rw-r--r--org/madore/damlengine/WeblogDatabaseConnection.java2
-rw-r--r--org/madore/damlengine/WeblogServlet.java4
-rw-r--r--org/madore/damlengine/cmdlines2
3 files changed, 4 insertions, 4 deletions
diff --git a/org/madore/damlengine/WeblogDatabaseConnection.java b/org/madore/damlengine/WeblogDatabaseConnection.java
index dfacebb..1a1828d 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 || conn.isClosed() ) {
+ if ( conn == null || conn.isClosed() || ! conn.isValid(5) ) {
String dbHost = null;
if ( ! DamlEngine.runAsServlet )
dbHost = System.getenv("DAMLENGINE_PGHOST");
diff --git a/org/madore/damlengine/WeblogServlet.java b/org/madore/damlengine/WeblogServlet.java
index 0e0ebe4..2ceb448 100644
--- a/org/madore/damlengine/WeblogServlet.java
+++ b/org/madore/damlengine/WeblogServlet.java
@@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletResponse;
/* Thinkos about the mess that is tomcat:
- * - Make sure that /usr/share/java/postgresql-jdbc3.jar (or whatever
+ * - Make sure that /usr/share/java/postgresql-jdbc4.jar (or whatever
* contains the class org.postgresql.Driver) is symlinked from
* /var/lib/tomcat7/common (or some path listed in the common.loader
* property of the catalina.properties file). Similarly,
@@ -34,7 +34,7 @@ import javax.servlet.http.HttpServletResponse;
public class WeblogServlet extends HttpServlet {
- private static final long serialVersionUID = 2014101202L;
+ private static final long serialVersionUID = 2014101203L;
@Override
public void init(ServletConfig cfg)
diff --git a/org/madore/damlengine/cmdlines b/org/madore/damlengine/cmdlines
index 29ecd0f..1128cd5 100644
--- a/org/madore/damlengine/cmdlines
+++ b/org/madore/damlengine/cmdlines
@@ -1,2 +1,2 @@
-export CLASSPATH=$HOME/java/damlengine:/usr/share/java/xercesImpl.jar:/usr/share/java/xml-resolver-1.2.jar:/usr/share/java/xml-commons-resolver-1.1.jar:/usr/share/java/postgresql-jdbc3.jar:/usr/share/java/servlet-api-3.0.jar
+export CLASSPATH=$HOME/java/damlengine:/usr/share/java/xercesImpl.jar:/usr/share/java/xml-resolver-1.2.jar:/usr/share/java/xml-commons-resolver-1.1.jar:/usr/share/java/postgresql-jdbc4.jar:/usr/share/java/servlet-api-3.0.jar
java org.madore.damlengine.DamlEngine some/file.daml