jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sch...@apache.org
Subject svn commit: r1399612 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
Date Thu, 18 Oct 2012 12:25:30 GMT
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;
     }
 



Mime
View raw message