Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jackrabbit-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ org.apache.jackrabbit.core.version.RemoveAndAddVersionLabelXATest#testVersionLab
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import junit.framework.TestCase;

import org.apache.commons.dbcp.BasicDataSource;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.derby.iapi.jdbc.EngineConnection;
import org.apache.jackrabbit.core.config.ConfigurationException;
import org.apache.jackrabbit.core.config.DataSourceConfig;
Expand Down Expand Up @@ -146,7 +146,7 @@ public void testClose() throws Exception {
}

private void assertPoolDefaults(BasicDataSource ds, String validationQuery, int maxCons) {
assertEquals(maxCons, ds.getMaxActive());
assertEquals(maxCons, ds.getMaxTotal());
assertEquals(validationQuery, ds.getValidationQuery());
assertTrue(ds.getDefaultAutoCommit());
assertFalse(ds.getTestOnBorrow());
Expand Down
6 changes: 3 additions & 3 deletions jackrabbit-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.14.0</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import javax.naming.NamingException;
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.commons.dbcp2.BasicDataSource;
import org.apache.commons.dbcp2.DelegatingConnection;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.apache.jackrabbit.core.config.DataSourceConfig;
import org.apache.jackrabbit.core.config.DataSourceConfig.DataSourceDefinition;
import org.apache.jackrabbit.util.Base64;
Expand Down Expand Up @@ -102,7 +102,7 @@ public void registerDataSources(DataSourceConfig dsc) throws RepositoryException
BasicDataSource bds =
getDriverDataSource(driverClass, def.getUrl(), def.getUser(), def.getPassword());
if (def.getMaxPoolSize() > 0) {
bds.setMaxActive(def.getMaxPoolSize());
bds.setMaxTotal(def.getMaxPoolSize());
}
if (def.getValidationQuery() != null && !"".equals(def.getValidationQuery().trim())) {
bds.setValidationQuery(def.getValidationQuery());
Expand Down Expand Up @@ -348,12 +348,14 @@ private BasicDataSource getDriverDataSource(
ds.setTestWhileIdle(true);
ds.setTimeBetweenEvictionRunsMillis(600000); // 10 Minutes
ds.setMinEvictableIdleTimeMillis(60000); // 1 Minute
ds.setMaxActive(-1); // unlimited
ds.setMaxIdle(GenericObjectPool.DEFAULT_MAX_IDLE + 10);
ds.setMaxTotal(-1); // unlimited
ds.setMaxIdle(GenericObjectPoolConfig.DEFAULT_MAX_IDLE + 10);
ds.setValidationQuery(guessValidationQuery(url));
ds.setAccessToUnderlyingConnectionAllowed(true);
ds.setPoolPreparedStatements(Boolean.valueOf(System.getProperty(SYSTEM_PROPERTY_POOL_PREPARED_STATEMENTS, "true")));
ds.setMaxOpenPreparedStatements(-1); // unlimited
// this helps to discover unusable connections of a shut-down database without executing a validation query
ds.setCacheState(false);
return ds;
}

Expand Down