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:28:59 UTC
svn commit: r1399616 -
/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
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;
}