jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sch...@apache.org
Subject svn commit: r1399616 - /jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
Date Thu, 18 Oct 2012 12:28:59 GMT
Author: schans
Date: Thu Oct 18 12:28:59 2012
New Revision: 1399616

URL: http://svn.apache.org/viewvc?rev=1399616&view=rev
Log:
JCR-3445: Gracefully handle error if the jdbc doesn't support the setValidationQueryTimeout
option (and remove greetings message ;-))

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

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java?rev=1399616&r1=1399615&r2=1399616&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
Thu Oct 18 12:28:59 2012
@@ -341,11 +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
-        log.info("Gruss von DVT");
+        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