You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by sc...@apache.org on 2012/10/18 14:25:30 UTC

svn commit: r1399612 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java

Author: schans
Date: Thu Oct 18 12:25:29 2012
New Revision: 1399612

URL: http://svn.apache.org/viewvc?rev=1399612&view=rev
Log:
JCR-3445: Gracefully handle error if the jdbc doesn't support the setValidationQueryTimeout option

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java?rev=1399612&r1=1399611&r2=1399612&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java Thu Oct 18 12:25:29 2012
@@ -341,10 +341,15 @@ public final class ConnectionFactory {
         ds.setMaxActive(-1); // unlimited
         ds.setMaxIdle(GenericObjectPool.DEFAULT_MAX_IDLE + 10);
         ds.setValidationQuery(guessValidationQuery(url));
-        ds.setValidationQueryTimeout(3);
         ds.setAccessToUnderlyingConnectionAllowed(true);
         ds.setPoolPreparedStatements(true);
         ds.setMaxOpenPreparedStatements(-1); // unlimited
+        try {
+            // JCR-3445 At the moment the PostgreSQL driver doesn't implement this method...
+            ds.setValidationQueryTimeout(3);
+        } catch (Exception e) {
+            log.info("Unable to set the validation query timeout on the datasource: " + e.getMessage());
+        }
         return ds;
     }