mirror of https://github.com/apache/openjpa.git
[OPENJPA-2750] Commons dbcp is updated to latest version - thx @solomax - This closes #22
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1841800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9a98d6a2bf
commit
f399f912cf
|
@ -134,8 +134,8 @@
|
|||
<artifactId>commons-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- bean validation includes -->
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1</bundle>
|
||||
<bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1</bundle>
|
||||
<bundle dependency="true">mvn:org.apache.commons/commons-pool2/2.6.0</bundle>
|
||||
<bundle dependency="true">mvn:commons-dbcp/commons-dbcp/1.4</bundle>
|
||||
<bundle dependency="true">mvn:org.apache.commons/commons-dbcp2/2.5.0</bundle>
|
||||
<bundle dependency="true">mvn:commons-collections/commons-collections/3.2.2</bundle>
|
||||
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1</bundle>
|
||||
<bundle dependency="true">mvn:org.apache.xbean/xbean-asm6-shaded/4.9</bundle>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
@ -65,8 +65,8 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -41,8 +41,8 @@ import org.apache.openjpa.lib.util.Closeable;
|
|||
public class DBCPDriverDataSource
|
||||
extends SimpleDriverDataSource implements Configurable, Closeable {
|
||||
|
||||
private static String DBCPPACKAGENAME = "org.apache.commons.dbcp";
|
||||
private static String DBCPBASICDATASOURCENAME = "org.apache.commons.dbcp.BasicDataSource";
|
||||
private static String DBCPPACKAGENAME = "org.apache.commons.dbcp2";
|
||||
private static String DBCPBASICDATASOURCENAME = "org.apache.commons.dbcp2.BasicDataSource";
|
||||
private static Class<?> _dbcpClass;
|
||||
private static Boolean _dbcpAvail;
|
||||
private static RuntimeException _dbcpEx;
|
||||
|
@ -59,7 +59,7 @@ extends SimpleDriverDataSource implements Configurable, Closeable {
|
|||
try {
|
||||
if (_ds != null) {
|
||||
if (isDBCPLoaded(getClassLoader())) {
|
||||
((org.apache.commons.dbcp.BasicDataSource)_dbcpClass.cast(_ds)).close();
|
||||
((org.apache.commons.dbcp2.BasicDataSource)_dbcpClass.cast(_ds)).close();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -106,7 +106,7 @@ extends SimpleDriverDataSource implements Configurable, Closeable {
|
|||
* This method should not throw an exception, as it is called by
|
||||
* AutoDriverDataSource to determine if user already specified
|
||||
* to use Commons DBCP.
|
||||
* @return true if ConnectionDriverName contains org.apache.commons.dbcp,
|
||||
* @return true if ConnectionDriverName contains org.apache.commons.dbcp2,
|
||||
* otherwise false
|
||||
*/
|
||||
protected boolean isDBCPDataSource() {
|
||||
|
@ -117,7 +117,7 @@ extends SimpleDriverDataSource implements Configurable, Closeable {
|
|||
/**
|
||||
* This method should not throw an exception, as it is called by
|
||||
* AutoDriverDataSource to determine if it should use DBCP or not
|
||||
* based on if org.apache.commons.dbcp.BasicDataSource can be loaded.
|
||||
* based on if org.apache.commons.dbcp2.BasicDataSource can be loaded.
|
||||
* @return true if Commons DBCP was found on the classpath, otherwise false
|
||||
*/
|
||||
static protected boolean isDBCPLoaded(ClassLoader cl) {
|
||||
|
|
|
@ -876,7 +876,7 @@ public class PostgresDictionary
|
|||
if (innerConn instanceof PGConnection) {
|
||||
return (PGConnection) innerConn;
|
||||
}
|
||||
if (innerConn.getClass().getName().startsWith("org.apache.commons.dbcp")) {
|
||||
if (innerConn.getClass().getName().startsWith("org.apache.commons.dbcp2")) {
|
||||
return (PGConnection) getDbcpDelegate(innerConn);
|
||||
}
|
||||
return (PGConnection) unwrapConnection(conn, PGConnection.class);
|
||||
|
@ -893,10 +893,10 @@ public class PostgresDictionary
|
|||
try {
|
||||
if (dbcpGetDelegate == null) {
|
||||
Class<?> dbcpConnectionClass =
|
||||
Class.forName("org.apache.commons.dbcp.DelegatingConnection", true, AccessController
|
||||
Class.forName("org.apache.commons.dbcp2.DelegatingConnection", true, AccessController
|
||||
.doPrivileged(J2DoPrivHelper.getContextClassLoaderAction()));
|
||||
Class<?> poolingDataSource = Class.forName(
|
||||
"org.apache.commons.dbcp.PoolingDataSource", true,
|
||||
"org.apache.commons.dbcp2.PoolingDataSource", true,
|
||||
AccessController.doPrivileged(J2DoPrivHelper
|
||||
.getContextClassLoaderAction()));
|
||||
Method setAccessToUnderlyingConnectionAllowed = poolingDataSource
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -557,7 +557,7 @@
|
|||
mvn test -Dtest=<testcase> -Ptest-derbynet
|
||||
-->
|
||||
<openjpa.derbyjcc.url>jdbc:db2://localhost:1527/openjpa20</openjpa.derbyjcc.url>
|
||||
<!-- Note: commons-dbcp requires dummy values for uid/pwd -->
|
||||
<!-- Note: commons-dbcp2 requires dummy values for uid/pwd -->
|
||||
<openjpa.derbyjcc.username>uid</openjpa.derbyjcc.username>
|
||||
<openjpa.derbyjcc.password>pwd</openjpa.derbyjcc.password>
|
||||
<connection.driver.name>com.ibm.db2.jcc.DB2Driver</connection.driver.name>
|
||||
|
|
|
@ -49,7 +49,7 @@ public class TestBadJdbcUrl extends TestCase {
|
|||
public static final String GOOD_DRIVER =
|
||||
"org.apache.derby.jdbc.EmbeddedDriver";
|
||||
public static final String GOOD_DATASOURCE =
|
||||
"org.apache.commons.dbcp.BasicDataSource";
|
||||
"org.apache.commons.dbcp2.BasicDataSource";
|
||||
|
||||
public static final String BAD_DRIVER = "bad.driver";
|
||||
public static final String BAD_URL_PROTOCOL = "bad.url.protocol";
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -534,7 +534,7 @@
|
|||
mvn test -Dtest=<testcase> -Ptest-derbynet
|
||||
-->
|
||||
<openjpa.derbyjcc.url>jdbc:db2://localhost:1527/openjpa20</openjpa.derbyjcc.url>
|
||||
<!-- Note: commons-dbcp requires dummy values for uid/pwd -->
|
||||
<!-- Note: commons-dbcp2 requires dummy values for uid/pwd -->
|
||||
<openjpa.derbyjcc.username>uid</openjpa.derbyjcc.username>
|
||||
<openjpa.derbyjcc.password>pwd</openjpa.derbyjcc.password>
|
||||
<connection.driver.name>com.ibm.db2.jcc.DB2Driver</connection.driver.name>
|
||||
|
|
|
@ -137,7 +137,7 @@
|
|||
<include>commons-collections:commons-collections</include>
|
||||
<include>org.apache.commons:commons-pool2</include>
|
||||
<include>commons-logging:commons-logging</include>
|
||||
<include>commons-dbcp:commons-dbcp</include>
|
||||
<include>org.apache.commons:commons-dbcp2</include>
|
||||
|
||||
<include>org.apache.geronimo.specs:geronimo-jta_1.1_spec</include>
|
||||
<include>org.apache.geronimo.specs:geronimo-jpa_2.1_spec</include>
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<include>commons-collections:commons-collections</include>
|
||||
<include>org.apache.commons:commons-pool2</include>
|
||||
<include>commons-logging:commons-logging</include>
|
||||
<include>commons-dbcp:commons-dbcp</include>
|
||||
<include>org.apache.commons:commons-dbcp2</include>
|
||||
|
||||
<include>org.apache.geronimo.specs:geronimo-jta_1.1_spec</include>
|
||||
<include>org.apache.geronimo.specs:geronimo-jpa_2.1_spec</include>
|
||||
|
|
|
@ -411,8 +411,8 @@
|
|||
<artifactId>commons-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- included for Apache Bean Validation provider -->
|
||||
|
|
|
@ -86,7 +86,7 @@ select between the old <classname>SimpleDriverDataSource</classname> and a new
|
|||
has been provided on the classpath and OpenJPA is not running in a container
|
||||
managed mode or with managed transactions. Note, that only the
|
||||
<literal>openjpa-all.jar</literal> includes Commons DBCP, so you will need to
|
||||
include the <literal>commons-dbcp.jar</literal> from the OpenJPA binary
|
||||
include the <literal>commons-dbcp2.jar</literal> from the OpenJPA binary
|
||||
distribution if you are using the normal <literal>openjpa.jar</literal>.
|
||||
</para>
|
||||
<para>
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</pluginRepositories>
|
||||
|
||||
<properties>
|
||||
<hsqldb.version>1.8.0.10</hsqldb.version>
|
||||
<hsqldb.version>2.4.1</hsqldb.version>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
@ -137,7 +137,7 @@
|
|||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
|
16
pom.xml
16
pom.xml
|
@ -74,7 +74,7 @@
|
|||
<createSources>false</createSources>
|
||||
<!-- common JDBC driver versions -->
|
||||
<derby.version>10.12.1.1</derby.version>
|
||||
<hsqldb.version>1.8.0.10</hsqldb.version>
|
||||
<hsqldb.version>2.4.1</hsqldb.version>
|
||||
<mysql.version>5.1.12</mysql.version>
|
||||
<postgresql.version>9.1-901-1.jdbc4</postgresql.version>
|
||||
<!-- other common versions -->
|
||||
|
@ -482,7 +482,7 @@
|
|||
<properties>
|
||||
<openjpa.derbynet.url>jdbc:derby://localhost:1527/openjpa20;create=true;traceDirectory=target;traceFile=derby.log</openjpa.derbynet.url>
|
||||
<openjpa.derbynet.driver>org.apache.derby.jdbc.ClientDriver</openjpa.derbynet.driver>
|
||||
<!-- Note: commons-dbcp requires dummy values for uid/pwd -->
|
||||
<!-- Note: commons-dbcp2 requires dummy values for uid/pwd -->
|
||||
<openjpa.derbynet.username>uid</openjpa.derbynet.username>
|
||||
<openjpa.derbynet.password>pwd</openjpa.derbynet.password>
|
||||
<connection.driver.name>${openjpa.derbynet.driver}</connection.driver.name>
|
||||
|
@ -554,9 +554,9 @@
|
|||
<version>${derby.version}</version>
|
||||
</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.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
|
@ -569,7 +569,7 @@
|
|||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>hsqldb</groupId>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>${hsqldb.version}</version>
|
||||
</dependency>
|
||||
|
@ -629,8 +629,8 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
Loading…
Reference in New Issue