jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cko...@apache.org
Subject svn commit: r1389745 - in /jackrabbit/branches/2.4/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java test/java/org/apache/jackrabbit/core/util/db/ConnectionFactoryTest.java
Date Tue, 25 Sep 2012 08:11:25 GMT
Author: ckoell
Date: Tue Sep 25 08:11:25 2012
New Revision: 1389745

URL: http://svn.apache.org/viewvc?rev=1389745&view=rev
Log:
JCR-3386 Adjust some default values of the BasicDataSource in the ConnectionFactory

Modified:
    jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
    jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/util/db/ConnectionFactoryTest.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=1389745&r1=1389744&r2=1389745&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
Tue Sep 25 08:11:25 2012
@@ -30,6 +30,7 @@ import javax.sql.DataSource;
 
 import org.apache.commons.dbcp.BasicDataSource;
 import org.apache.commons.dbcp.DelegatingConnection;
+import org.apache.commons.pool.impl.GenericObjectPool;
 import org.apache.jackrabbit.core.config.DataSourceConfig;
 import org.apache.jackrabbit.core.config.DataSourceConfig.DataSourceDefinition;
 import org.apache.jackrabbit.util.Base64;
@@ -335,12 +336,16 @@ public final class ConnectionFactory {
         ds.setDefaultAutoCommit(true);
         ds.setTestOnBorrow(false);
         ds.setTestWhileIdle(true);
-        ds.setTimeBetweenEvictionRunsMillis(1000);
+        ds.setTimeBetweenEvictionRunsMillis(600000); // 10 Minutes
+        ds.setMinEvictableIdleTimeMillis(60000); // 1 Minute
         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");
         return ds;
     }
 

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/util/db/ConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/util/db/ConnectionFactoryTest.java?rev=1389745&r1=1389744&r2=1389745&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/util/db/ConnectionFactoryTest.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/util/db/ConnectionFactoryTest.java
Tue Sep 25 08:11:25 2012
@@ -151,7 +151,7 @@ public class ConnectionFactoryTest exten
         assertTrue(ds.getDefaultAutoCommit());
         assertFalse(ds.getTestOnBorrow());
         assertTrue(ds.getTestWhileIdle());
-        assertEquals(1000, ds.getTimeBetweenEvictionRunsMillis());
+        assertEquals(600000, ds.getTimeBetweenEvictionRunsMillis());
         assertTrue(ds.isPoolPreparedStatements());
         assertEquals(-1, ds.getMaxOpenPreparedStatements());
     }



Mime
View raw message