diff -Nru commons-dbcp2-2.6.0/CONTRIBUTING.md commons-dbcp2-2.7.0/CONTRIBUTING.md
--- commons-dbcp2-2.6.0/CONTRIBUTING.md 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/CONTRIBUTING.md 2019-07-31 12:46:24.000000000 +0000
@@ -1,115 +1,115 @@
-
-
-Contributing to Apache Commons DBCP
-======================
-
-You have found a bug or you have an idea for a cool new feature? Contributing code is a great way to give something back to
-the open source community. Before you dig right into the code there are a few guidelines that we need contributors to
-follow so that we can have a chance of keeping on top of things.
-
-Getting Started
----------------
-
-+ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
-+ Make sure you have a [GitHub account](https://github.com/signup/free).
-+ If you're planning to implement a new feature it makes sense to discuss your changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons DBCP's scope.
-+ Submit a [Jira Ticket][jira] for your issue, assuming one does not already exist.
- + Clearly describe the issue including steps to reproduce when it is a bug.
- + Make sure you fill in the earliest version that you know has the issue.
-+ Find the corresponding [repository on GitHub](https://github.com/apache/?query=commons-),
-[fork](https://help.github.com/articles/fork-a-repo/) and check out your forked repository.
-
-Making Changes
---------------
-
-+ Create a _topic branch_ for your isolated work.
- * Usually you should base your branch on the `master` or `trunk` branch.
- * A good topic branch name can be the JIRA bug id plus a keyword, e.g. `DBCP-123-InputStream`.
- * If you have submitted multiple JIRA issues, try to maintain separate branches and pull requests.
-+ Make commits of logical units.
- * Make sure your commit messages are meaningful and in the proper format. Your commit message should contain the key of the JIRA issue.
- * e.g. `DBCP-123: Close input stream earlier`
-+ Respect the original code style:
- + Only use spaces for indentation.
- + Create minimal diffs - disable _On Save_ actions like _Reformat Source Code_ or _Organize Imports_. If you feel the source code should be reformatted create a separate PR for this change first.
- + Check for unnecessary whitespace with `git diff` -- check before committing.
-+ Make sure you have added the necessary tests for your changes, typically in `src/test/java`.
-+ Run all the tests with `mvn clean verify` to assure nothing else was accidentally broken.
-
-Making Trivial Changes
-----------------------
-
-The JIRA tickets are used to generate the changelog for the next release.
-
-For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA.
-In this case, it is appropriate to start the first line of a commit with '(doc)' instead of a ticket number.
-
-
-Submitting Changes
-------------------
-
-+ Sign and submit the Apache [Contributor License Agreement][cla] if you haven't already.
- * Note that small patches & typical bug fixes do not require a CLA as
- clause 5 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0.html#contributions)
- covers them.
-+ Push your changes to a topic branch in your fork of the repository.
-+ Submit a _Pull Request_ to the corresponding repository in the `apache` organization.
- * Verify _Files Changed_ shows only your intended changes and does not
- include additional files like `target/*.class`
-+ Update your JIRA ticket and include a link to the pull request in the ticket.
-
-If you prefer to not use GitHub, then you can instead use
-`git format-patch` (or `svn diff`) and attach the patch file to the JIRA issue.
-
-
-Additional Resources
---------------------
-
-+ [Contributing patches](https://commons.apache.org/patches.html)
-+ [Apache Commons DBCP JIRA project page][jira]
-+ [Contributor License Agreement][cla]
-+ [General GitHub documentation](https://help.github.com/)
-+ [GitHub pull request documentation](https://help.github.com/articles/creating-a-pull-request/)
-+ [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
-+ `#apache-commons` IRC channel on `irc.freenode.net`
-
-[cla]:https://www.apache.org/licenses/#clas
-[jira]:https://issues.apache.org/jira/browse/DBCP
+
+
+Contributing to Apache Commons DBCP
+======================
+
+You have found a bug or you have an idea for a cool new feature? Contributing code is a great way to give something back to
+the open source community. Before you dig right into the code there are a few guidelines that we need contributors to
+follow so that we can have a chance of keeping on top of things.
+
+Getting Started
+---------------
+
++ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
++ Make sure you have a [GitHub account](https://github.com/signup/free).
++ If you're planning to implement a new feature it makes sense to discuss your changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons DBCP's scope.
++ Submit a [Jira Ticket][jira] for your issue, assuming one does not already exist.
+ + Clearly describe the issue including steps to reproduce when it is a bug.
+ + Make sure you fill in the earliest version that you know has the issue.
++ Find the corresponding [repository on GitHub](https://github.com/apache/?query=commons-),
+[fork](https://help.github.com/articles/fork-a-repo/) and check out your forked repository.
+
+Making Changes
+--------------
+
++ Create a _topic branch_ for your isolated work.
+ * Usually you should base your branch on the `master` or `trunk` branch.
+ * A good topic branch name can be the JIRA bug id plus a keyword, e.g. `DBCP-123-InputStream`.
+ * If you have submitted multiple JIRA issues, try to maintain separate branches and pull requests.
++ Make commits of logical units.
+ * Make sure your commit messages are meaningful and in the proper format. Your commit message should contain the key of the JIRA issue.
+ * e.g. `DBCP-123: Close input stream earlier`
++ Respect the original code style:
+ + Only use spaces for indentation.
+ + Create minimal diffs - disable _On Save_ actions like _Reformat Source Code_ or _Organize Imports_. If you feel the source code should be reformatted create a separate PR for this change first.
+ + Check for unnecessary whitespace with `git diff` -- check before committing.
++ Make sure you have added the necessary tests for your changes, typically in `src/test/java`.
++ Run all the tests with `mvn clean verify` to assure nothing else was accidentally broken.
+
+Making Trivial Changes
+----------------------
+
+The JIRA tickets are used to generate the changelog for the next release.
+
+For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA.
+In this case, it is appropriate to start the first line of a commit with '(doc)' instead of a ticket number.
+
+
+Submitting Changes
+------------------
+
++ Sign and submit the Apache [Contributor License Agreement][cla] if you haven't already.
+ * Note that small patches & typical bug fixes do not require a CLA as
+ clause 5 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0.html#contributions)
+ covers them.
++ Push your changes to a topic branch in your fork of the repository.
++ Submit a _Pull Request_ to the corresponding repository in the `apache` organization.
+ * Verify _Files Changed_ shows only your intended changes and does not
+ include additional files like `target/*.class`
++ Update your JIRA ticket and include a link to the pull request in the ticket.
+
+If you prefer to not use GitHub, then you can instead use
+`git format-patch` (or `svn diff`) and attach the patch file to the JIRA issue.
+
+
+Additional Resources
+--------------------
+
++ [Contributing patches](https://commons.apache.org/patches.html)
++ [Apache Commons DBCP JIRA project page][jira]
++ [Contributor License Agreement][cla]
++ [General GitHub documentation](https://help.github.com/)
++ [GitHub pull request documentation](https://help.github.com/articles/creating-a-pull-request/)
++ [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
++ `#apache-commons` IRC channel on `irc.freenode.net`
+
+[cla]:https://www.apache.org/licenses/#clas
+[jira]:https://issues.apache.org/jira/browse/DBCP
diff -Nru commons-dbcp2-2.6.0/debian/changelog commons-dbcp2-2.7.0/debian/changelog
--- commons-dbcp2-2.6.0/debian/changelog 2019-07-18 21:43:30.000000000 +0000
+++ commons-dbcp2-2.7.0/debian/changelog 2019-08-11 22:20:00.000000000 +0000
@@ -1,3 +1,9 @@
+commons-dbcp2 (2.7.0-1) unstable; urgency=medium
+
+ * New upstream version 2.7.0.
+
+ -- Markus Koschany Mon, 12 Aug 2019 00:20:00 +0200
+
commons-dbcp2 (2.6.0-1) unstable; urgency=medium
* New upstream version 2.6.0.
diff -Nru commons-dbcp2-2.6.0/debian/maven.ignoreRules commons-dbcp2-2.7.0/debian/maven.ignoreRules
--- commons-dbcp2-2.6.0/debian/maven.ignoreRules 2019-07-18 21:43:30.000000000 +0000
+++ commons-dbcp2-2.7.0/debian/maven.ignoreRules 2019-08-11 22:20:00.000000000 +0000
@@ -19,3 +19,4 @@
org.slf4j slf4j-simple * * * *
tomcat naming-common * * * *
tomcat naming-java * * * *
+org.junit.jupiter junit-jupiter * * * *
diff -Nru commons-dbcp2-2.6.0/NOTICE.txt commons-dbcp2-2.7.0/NOTICE.txt
--- commons-dbcp2-2.6.0/NOTICE.txt 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/NOTICE.txt 2019-07-31 12:46:24.000000000 +0000
@@ -1,5 +1,5 @@
-Apache Commons DBCP
-Copyright 2001-2019 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
+Apache Commons DBCP
+Copyright 2001-2019 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff -Nru commons-dbcp2-2.6.0/pom.xml commons-dbcp2-2.7.0/pom.xml
--- commons-dbcp2-2.6.0/pom.xml 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/pom.xml 2019-07-31 12:46:24.000000000 +0000
@@ -1,507 +1,515 @@
-
-
-
-
- org.apache.commons
- commons-parent
- 47
-
- 4.0.0
- commons-dbcp2
- 2.6.0
- Apache Commons DBCP
-
- 2001
- Apache Commons DBCP software implements Database Connection Pooling
- http://commons.apache.org/dbcp/
-
-
-
-
- apache.website
- Apache Commons Site
- scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-dbcp/
-
-
-
-
- jira
- http://issues.apache.org/jira/browse/DBCP
-
-
-
- scm:git:http://git-wip-us.apache.org/repos/asf/commons-dbcp.git
- scm:git:https://git-wip-us.apache.org/repos/asf/commons-dbcp.git
- https://git-wip-us.apache.org/repos/asf?p=commons-dbcp.git
-
-
-
-
- Morgan Delagrange
- morgand
-
-
-
-
- Geir Magnusson
- geirm
-
-
-
-
- Craig McClanahan
- craigmcc
-
-
-
-
- John McNally
- jmcnally
-
-
-
-
- Martin Poeschl
- mpoeschl
- mpoeschl@marmot.at
- tucana.at
-
-
- Rodney Waldhoff
- rwaldhoff
-
-
-
-
- David Weinrich
- dweinr1
-
-
-
-
- Dirk Verbeeck
- dirkv
-
-
-
-
- Yoav Shapira
- yoavs
- yoavs@apache.org
- The Apache Software Foundation
-
-
- Jörg Schaible
- joehni
- joerg.schaible@gmx.de
-
- +1
-
-
- Mark Thomas
- markt
- markt@apache.org
- The Apache Software Foundation
-
-
- Gary Gregory
- ggregory
- ggregory@apache.org
- The Apache Software Foundation
-
-
- Ignacio J. Ortega
- nacho
-
-
- Sean C. Sullivan
- sullis
-
-
-
-
- Todd Carmichael
- toddc@concur.com
-
-
- Wayne Woodfield
-
-
- Dain Sundstrom
- dain@apache.org
-
-
- Philippe Mouawad
-
-
- Glenn L. Nielsen
-
-
- James House
-
-
- James Ring
-
-
- Peter Wicks
- pwicks@apache.org
-
-
-
-
-
- org.apache.commons
- commons-pool2
- ${commons.pool.version}
-
-
-
- commons-logging
- commons-logging
- 1.2
-
-
-
- junit
- junit
- 4.12
- test
-
-
-
- org.mockito
- mockito-core
- 2.24.0
- test
-
-
-
-
- org.apache.geronimo.specs
- geronimo-jta_1.1_spec
- 1.1.1
- true
-
-
-
-
- tomcat
- naming-common
- 5.0.28
- test
-
-
-
- tomcat
- naming-java
- 5.0.28
- test
-
-
-
-
- org.apache.geronimo.modules
- geronimo-transaction
- 2.2.1
- test
-
-
- junit
- junit
-
-
- commons-logging
- commons-logging
-
-
-
-
- org.slf4j
- slf4j-simple
- 1.7.25
- test
-
-
- com.h2database
- h2
- 1.4.197
- test
-
-
- org.jboss.narayana.jta
- narayana-jta
- 5.9.2.Final
- test
-
-
- org.jboss.spec.javax.transaction
- jboss-transaction-api_1.2_spec
- 1.1.1.Final
- test
-
-
- org.jboss
- jboss-transaction-spi
- 7.6.0.Final
-
-
- org.jboss.logging
- jboss-logging-spi
-
-
- test
-
-
- org.jboss.logging
- jboss-logging
- 3.3.2.Final
- test
-
-
-
-
- UTF-8
- UTF-8
- 1.8
- 1.8
- dbcp
- RC1
- org.apache.commons.dbcp2
-
- 2.6.0
- for JDBC 4.2 on Java 8
-
- 2.4.0
- for JDBC 4.1 on Java 7
-
-
- commons-dbcp-${commons.release.3.version}
- 1.4
- for JDBC 4 on Java 6
-
-
- commons-dbcp-${commons.release.4.version}
- 1.3
- for JDBC 3 on Java 1.4 or 5
-
- dbcp
- https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-dbcp
- site-content
- DBCP
- 12310469
-
- 3.0.0
-
- 2.6.1
- 0.13.0
-
- javax.transaction;version="1.1.0",javax.transaction.xa;version="1.1.0";partial=true;mandatory:=partial,*
- true
-
- 2.5.0
- true
- Gary Gregory
- 86fdc7e2a11262cb
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-scm-publish-plugin
- ${commons.scm-publish.version}
-
-
- javadocs
-
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- ${commons.checkstyle.version}
-
- ${basedir}/checkstyle.xml
- false
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.commons.dbcp2.StackMessageLog
-
-
-
- **/Tester*.java
-
- **/Test*$*.java
-
-
-
-
- maven-assembly-plugin
-
-
- src/main/assembly/bin.xml
- src/main/assembly/src-tar-gz.xml
- src/main/assembly/src-zip.xml
-
- gnu
-
-
-
- org.apache.maven.plugins
- maven-scm-publish-plugin
-
-
- api-*
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- ${commons.javadoc.version}
-
-
- http://docs.oracle.com/javase/7/docs/api
- http://commons.apache.org/proper/commons-pool/api-${commons.pool.version}
- http://docs.oracle.com/javaee/7/api/
-
-
-
-
-
-
-
-
- com.github.siom79.japicmp
- japicmp-maven-plugin
- ${commons.japicmp.version}
-
-
-
-
-
-
-
-
-
-
-
-
- true
- ${commons.japicmp.breakBuildOnBinaryIncompatibleModifications}
-
- true
- true
- true
- ${commons.japicmp.ignoreMissingClasses}
- ${commons.bc.version}
-
-
-
- org.apache.geronimo.specs
- geronimo-jta_1.1_spec
- 1.1.1
-
-
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
- 3.0.5
-
- Normal
- Default
- ${basedir}/findbugs-exclude-filter.xml
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- ${commons.javadoc.version}
-
-
- http://docs.oracle.com/javase/7/docs/api
- http://commons.apache.org/proper/commons-pool/api-${commons.pool.version}
- http://docs.oracle.com/javaee/7/api/
-
-
-
-
- org.apache.maven.plugins
- maven-changes-plugin
- ${commons.changes.version}
-
- release-notes.vm
- src/changes
-
-
- 12313721,12326766,12328750
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- ${commons.checkstyle.version}
-
- ${basedir}/checkstyle.xml
- false
-
-
-
- org.codehaus.mojo
- clirr-maven-plugin
- ${commons.clirr.version}
-
- info
-
-
-
- maven-pmd-plugin
- 3.11.0
-
- ${maven.compiler.target}
-
-
-
-
- pmd
- cpd
-
-
-
-
-
-
-
-
-
+
+
+
+
+ org.apache.commons
+ commons-parent
+ 48
+
+ 4.0.0
+ commons-dbcp2
+ 2.7.0
+ Apache Commons DBCP
+
+ 2001
+ Apache Commons DBCP software implements Database Connection Pooling
+ https://commons.apache.org/dbcp/
+
+
+
+
+ apache.website
+ Apache Commons Site
+ scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-dbcp/
+
+
+
+
+ jira
+ https://issues.apache.org/jira/browse/DBCP
+
+
+
+ scm:git:http://git-wip-us.apache.org/repos/asf/commons-dbcp.git
+ scm:git:https://git-wip-us.apache.org/repos/asf/commons-dbcp.git
+ https://git-wip-us.apache.org/repos/asf?p=commons-dbcp.git
+
+
+
+
+ Morgan Delagrange
+ morgand
+
+
+
+
+ Geir Magnusson
+ geirm
+
+
+
+
+ Craig McClanahan
+ craigmcc
+
+
+
+
+ John McNally
+ jmcnally
+
+
+
+
+ Martin Poeschl
+ mpoeschl
+ mpoeschl@marmot.at
+ tucana.at
+
+
+ Rodney Waldhoff
+ rwaldhoff
+
+
+
+
+ David Weinrich
+ dweinr1
+
+
+
+
+ Dirk Verbeeck
+ dirkv
+
+
+
+
+ Yoav Shapira
+ yoavs
+ yoavs@apache.org
+ The Apache Software Foundation
+
+
+ Jörg Schaible
+ joehni
+ joerg.schaible@gmx.de
+
+ +1
+
+
+ Mark Thomas
+ markt
+ markt@apache.org
+ The Apache Software Foundation
+
+
+ Gary Gregory
+ ggregory
+ ggregory@apache.org
+ The Apache Software Foundation
+
+
+ Ignacio J. Ortega
+ nacho
+
+
+ Sean C. Sullivan
+ sullis
+
+
+
+
+ Todd Carmichael
+ toddc@concur.com
+
+
+ Wayne Woodfield
+
+
+ Dain Sundstrom
+ dain@apache.org
+
+
+ Philippe Mouawad
+
+
+ Glenn L. Nielsen
+
+
+ James House
+
+
+ James Ring
+
+
+ Peter Wicks
+ pwicks@apache.org
+
+
+
+
+
+ org.apache.commons
+ commons-pool2
+ ${commons.pool.version}
+
+
+
+ commons-logging
+ commons-logging
+ 1.2
+
+
+
+ org.junit.jupiter
+ junit-jupiter
+ 5.5.1
+ test
+
+
+
+ org.hamcrest
+ hamcrest-all
+ 1.3
+ test
+
+
+
+ org.mockito
+ mockito-core
+ 3.0.0
+ test
+
+
+
+
+ org.apache.geronimo.specs
+ geronimo-jta_1.1_spec
+ 1.1.1
+ true
+
+
+
+
+ tomcat
+ naming-common
+ 5.0.28
+ test
+
+
+
+ tomcat
+ naming-java
+ 5.0.28
+ test
+
+
+
+
+ org.apache.geronimo.modules
+ geronimo-transaction
+ 2.2.1
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+ org.slf4j
+ slf4j-simple
+ 1.7.26
+ test
+
+
+ com.h2database
+ h2
+ 1.4.199
+ test
+
+
+ org.jboss.narayana.jta
+ narayana-jta
+ 5.9.5.Final
+ test
+
+
+ org.jboss.spec.javax.transaction
+ jboss-transaction-api_1.2_spec
+ 1.1.1.Final
+ test
+
+
+ org.jboss
+ jboss-transaction-spi
+ 7.6.0.Final
+
+
+ org.jboss.logging
+ jboss-logging-spi
+
+
+ test
+
+
+ org.jboss.logging
+ jboss-logging
+ 3.4.0.Final
+ test
+
+
+
+
+ UTF-8
+ UTF-8
+ 1.8
+ 1.8
+ dbcp
+ RC1
+ org.apache.commons.dbcp2
+
+ 2.7.0
+ for JDBC 4.2 on Java 8
+
+ 2.4.0
+ for JDBC 4.1 on Java 7
+
+
+ commons-dbcp-${commons.release.3.version}
+ 1.4
+ for JDBC 4 on Java 6
+
+
+ commons-dbcp-${commons.release.4.version}
+ 1.3
+ for JDBC 3 on Java 1.4 or 5
+
+ dbcp
+ https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-dbcp
+ site-content
+ DBCP
+ 12310469
+
+ 3.0.0
+ 3.1.1
+
+ 2.7.0
+ 0.13.1
+ 0.8.4
+
+ javax.transaction;version="1.1.0",javax.transaction.xa;version="1.1.0";partial=true;mandatory:=partial,*
+ true
+
+ 2.6.0
+ true
+ Gary Gregory
+ 86fdc7e2a11262cb
+
+ false
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-scm-publish-plugin
+ ${commons.scm-publish.version}
+
+
+ javadocs
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ ${commons.checkstyle.version}
+
+ ${basedir}/checkstyle.xml
+ false
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+
+ org.apache.commons.dbcp2.StackMessageLog
+
+
+
+ **/Tester*.java
+
+ **/Test*$*.java
+
+
+
+
+ maven-assembly-plugin
+
+
+ src/main/assembly/bin.xml
+ src/main/assembly/src-tar-gz.xml
+ src/main/assembly/src-zip.xml
+
+ gnu
+
+
+
+ org.apache.maven.plugins
+ maven-scm-publish-plugin
+
+
+ api-*
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${commons.javadoc.version}
+
+
+ http://docs.oracle.com/javase/7/docs/api
+ https://commons.apache.org/proper/commons-pool/api-${commons.pool.version}
+ http://docs.oracle.com/javaee/7/api/
+
+
+
+
+
+
+
+
+ com.github.siom79.japicmp
+ japicmp-maven-plugin
+ ${commons.japicmp.version}
+
+
+
+ cmp-report
+
+
+
+
+
+ true
+ ${commons.japicmp.breakBuildOnBinaryIncompatibleModifications}
+
+ true
+ true
+ true
+ ${commons.japicmp.ignoreMissingClasses}
+ ${commons.bc.version}
+
+
+
+ org.apache.geronimo.specs
+ geronimo-jta_1.1_spec
+ 1.1.1
+
+
+
+
+
+ org.codehaus.mojo
+ findbugs-maven-plugin
+ 3.0.5
+
+ Normal
+ Default
+ ${basedir}/findbugs-exclude-filter.xml
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${commons.javadoc.version}
+
+
+ http://docs.oracle.com/javase/7/docs/api
+ https://commons.apache.org/proper/commons-pool/api-${commons.pool.version}
+ http://docs.oracle.com/javaee/7/api/
+
+
+
+
+ org.apache.maven.plugins
+ maven-changes-plugin
+ ${commons.changes.version}
+
+ release-notes.vm
+ src/changes
+
+
+ 12313721,12326766,12328750
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ ${commons.checkstyle.version}
+
+ ${basedir}/checkstyle.xml
+ false
+
+
+
+ org.codehaus.mojo
+ clirr-maven-plugin
+ ${commons.clirr.version}
+
+ info
+
+
+
+ maven-pmd-plugin
+ 3.12.0
+
+ ${maven.compiler.target}
+
+
+
+
+ pmd
+ cpd
+
+
+
+
+
+
+
+
+
diff -Nru commons-dbcp2-2.6.0/README.md commons-dbcp2-2.7.0/README.md
--- commons-dbcp2-2.6.0/README.md 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/README.md 2019-07-31 12:46:24.000000000 +0000
@@ -1,105 +1,105 @@
-
-
-Apache Commons DBCP
-===================
-
-[![Build Status](https://travis-ci.org/apache/commons-dbcp.svg)](https://travis-ci.org/apache/commons-dbcp)
-[![Coverage Status](https://coveralls.io/repos/apache/commons-dbcp/badge.svg)](https://coveralls.io/r/apache/commons-dbcp)
-[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-dbcp2/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-dbcp2/)
-[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-dbcp2/2.6.0.svg)](https://javadoc.io/doc/org.apache.commons/commons-dbcp2/2.6.0)
-
-Apache Commons DBCP software implements Database Connection Pooling
-
-Documentation
--------------
-
-More information can be found on the [Apache Commons DBCP homepage](https://commons.apache.org/proper/commons-dbcp).
-The [Javadoc](https://commons.apache.org/proper/commons-dbcp/javadocs/api-release) can be browsed.
-Questions related to the usage of Apache Commons DBCP should be posted to the [user mailing list][ml].
-
-Where can I get the latest release?
------------------------------------
-You can download source and binaries from our [download page](https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi).
-
-Alternatively you can pull it from the central Maven repositories:
-
-```xml
-
- org.apache.commons
- commons-dbcp2
- 2.6.0
-
-```
-
-Contributing
-------------
-
-We accept Pull Requests via GitHub. The [developer mailing list][ml] is the main channel of communication for contributors.
-There are some guidelines which will make applying PRs easier for us:
-+ No tabs! Please use spaces for indentation.
-+ Respect the code style.
-+ Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
-+ Provide JUnit tests for your changes and make sure your changes don't break any existing tests by running ```mvn clean test```.
-
-If you plan to contribute on a regular basis, please consider filing a [contributor license agreement](https://www.apache.org/licenses/#clas).
-You can learn more about contributing via GitHub in our [contribution guidelines](CONTRIBUTING.md).
-
-License
--------
-This code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0).
-
-See the `NOTICE.txt` file for required notices and attributions.
-
-Donations
----------
-You like Apache Commons DBCP? Then [donate back to the ASF](https://www.apache.org/foundation/contributing.html) to support the development.
-
-Additional Resources
---------------------
-
-+ [Apache Commons Homepage](https://commons.apache.org/)
-+ [Apache Issue Tracker (JIRA)](https://issues.apache.org/jira/browse/DBCP)
-+ [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
-+ `#apache-commons` IRC channel on `irc.freenode.org`
-
-[ml]:https://commons.apache.org/mail-lists.html
+
+
+Apache Commons DBCP
+===================
+
+[![Build Status](https://travis-ci.org/apache/commons-dbcp.svg)](https://travis-ci.org/apache/commons-dbcp)
+[![Coverage Status](https://coveralls.io/repos/apache/commons-dbcp/badge.svg)](https://coveralls.io/r/apache/commons-dbcp)
+[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-dbcp2/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-dbcp2/)
+[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-dbcp2/2.7.0.svg)](https://javadoc.io/doc/org.apache.commons/commons-dbcp2/2.7.0)
+
+Apache Commons DBCP software implements Database Connection Pooling
+
+Documentation
+-------------
+
+More information can be found on the [Apache Commons DBCP homepage](https://commons.apache.org/proper/commons-dbcp).
+The [Javadoc](https://commons.apache.org/proper/commons-dbcp/javadocs/api-release) can be browsed.
+Questions related to the usage of Apache Commons DBCP should be posted to the [user mailing list][ml].
+
+Where can I get the latest release?
+-----------------------------------
+You can download source and binaries from our [download page](https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi).
+
+Alternatively you can pull it from the central Maven repositories:
+
+```xml
+
+ org.apache.commons
+ commons-dbcp2
+ 2.7.0
+
+```
+
+Contributing
+------------
+
+We accept Pull Requests via GitHub. The [developer mailing list][ml] is the main channel of communication for contributors.
+There are some guidelines which will make applying PRs easier for us:
++ No tabs! Please use spaces for indentation.
++ Respect the code style.
++ Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
++ Provide JUnit tests for your changes and make sure your changes don't break any existing tests by running ```mvn clean test```.
+
+If you plan to contribute on a regular basis, please consider filing a [contributor license agreement](https://www.apache.org/licenses/#clas).
+You can learn more about contributing via GitHub in our [contribution guidelines](CONTRIBUTING.md).
+
+License
+-------
+This code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0).
+
+See the `NOTICE.txt` file for required notices and attributions.
+
+Donations
+---------
+You like Apache Commons DBCP? Then [donate back to the ASF](https://www.apache.org/foundation/contributing.html) to support the development.
+
+Additional Resources
+--------------------
+
++ [Apache Commons Homepage](https://commons.apache.org/)
++ [Apache Issue Tracker (JIRA)](https://issues.apache.org/jira/browse/DBCP)
++ [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
++ `#apache-commons` IRC channel on `irc.freenode.org`
+
+[ml]:https://commons.apache.org/mail-lists.html
diff -Nru commons-dbcp2-2.6.0/README.txt commons-dbcp2-2.7.0/README.txt
--- commons-dbcp2-2.6.0/README.txt 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/README.txt 2019-07-31 12:46:24.000000000 +0000
@@ -2,7 +2,7 @@
===========================
Welcome to the DBCP component of the Apache Commons
-project (http://commons.apache.org).
+project (https://commons.apache.org).
DBCP version 2.5.0 requires JDK 1.8.
@@ -11,6 +11,6 @@
build.properties. There is a build.properties.sample file included in the
source distribution.
-See http://commons.apache.org/dbcp/ for additional and
+See https://commons.apache.org/dbcp/ for additional and
up-to-date information on Commons DBCP.
diff -Nru commons-dbcp2-2.6.0/RELEASE-NOTES.txt commons-dbcp2-2.7.0/RELEASE-NOTES.txt
--- commons-dbcp2-2.6.0/RELEASE-NOTES.txt 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/RELEASE-NOTES.txt 2019-07-31 12:46:24.000000000 +0000
@@ -1,4 +1,58 @@
Apache Apache Commons DBCP
+ Version 2.7.0
+ RELEASE NOTES
+ 7 July 2019
+
+The Apache Commons DBCP team is pleased to announce the release of Apache Apache Commons DBCP 2.7.0.
+
+Apache Commons DBCP software implements Database Connection Pooling.
+
+This is a minor release, including bug fixes and enhancements.
+
+Changes in this version include:
+
+New features:
+o DBCP-539: ManagedDataSource#close() should declare used exceptions. Thanks to Jacques Le Roux.
+o DBCP-547: Add a ConnectionFactory class name setting for BasicDataSource.createConnectionFactory() #33. Thanks to leechoongyon, Gary Gregory.
+o Add missing Javadocs. Thanks to Gary Gregory.
+
+Fixed Bugs:
+o DBCP-538: Wrong JMX base name derived in BasicDataSource#updateJmxName. Thanks to Ragnar Haugan, Gary Gregory.
+o DBCP-546: Avoid NPE when calling DriverAdapterCPDS.toString(). Thanks to Sergey Chupov.
+o DBCP-550: java.util.IllegalFormatException while building a message for a SQLFeatureNotSupportedException in Jdbc41Bridge.getObject(ResultSet,String,Class). Thanks to Gary Gregory.
+o Fix Javadoc link in README.md #21. Thanks to LichKing-lee.
+
+Changes:
+o DBCP-540: Close ObjectOutputStream before calling toByteArray() on underlying ByteArrayOutputStream #28. Thanks to emopers.
+o DBCP-541: Upgrade to JUnit Jupiter #19. Thanks to Allon Murienik.
+o DBCP-542: Fix tests on Java 11. Thanks to Zheng Feng, Gary Gregory.
+o DBCP-543: Update Apache Commons Pool from 2.6.1 to 2.6.2. Thanks to Gary Gregory.
+o DBCP-529: Add 'jmxName' property to web configuration parameters listing. Thanks to Yuri.
+o DBCP-548: Update Apache Commons Pool from 2.6.2 to 2.7.0. Thanks to Gary Gregory.
+o DBCP-549: Make org.apache.commons.dbcp2.AbandonedTrace.removeTrace(AbandonedTrace) null-safe. Thanks to Gary Gregory.
+o DBCP-551: org.apache.commons.dbcp2.DelegatingStatement.close() should try to close ALL of its result sets even when an exception occurs. Thanks to Gary Gregory.
+o DBCP-552: org.apache.commons.dbcp2.DelegatingConnection.passivate() should close ALL of its resources even when an exception occurs. Thanks to Gary Gregory.
+o DBCP-553: org.apache.commons.dbcp2.PoolablePreparedStatement.passivate() should close ALL of its resources even when an exception occurs. Thanks to Gary Gregory.
+o DBCP-554: org.apache.commons.dbcp2.PoolableCallableStatement.passivate() should close ALL of its resources even when an exception occurs. Thanks to Gary Gregory.
+o Update tests from org.mockito:mockito-core 2.28.2 to 3.0.0. Thanks to Gary Gregory.
+o Update tests from H2 1.4.198 to 1.4.199. Thanks to Gary Gregory.
+o Update tests from com.h2database:h2 1.4.197 to 1.4.199. Thanks to Gary Gregory.
+o Update tests from org.jboss.narayana.jta:narayana-jta 5.9.2.Final to 5.9.5.Final. Thanks to Gary Gregory.
+o Update tests from org.jboss.logging:jboss-logging 3.3.2.Final to 3.4.0.Final. Thanks to Gary Gregory.
+o Update tests from org.mockito:mockito-core 2.24.0 to 2.28.2. Thanks to Gary Gregory.
+o Update tests from org.mockito:mockito-core 2.28.2 to 3.0.0. Thanks to Gary Gregory.
+
+
+For complete information on Apache Commons DBCP, including instructions on how to submit bug reports,
+patches, or suggestions for improvement, see the Apache Apache Commons DBCP website:
+
+https://commons.apache.org/dbcp/
+
+Download page: https://commons.apache.org/dbcp/download_dbcp.cgi
+
+-----------------------------------------------------------------------------
+
+ Apache Apache Commons DBCP
Version 2.6.0
RELEASE NOTES
@@ -31,9 +85,9 @@
For complete information on Apache Commons DBCP, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons DBCP website:
-http://commons.apache.org/dbcp/
+https://commons.apache.org/dbcp/
-Download page: http://commons.apache.org/dbcp/download_dbcp.cgi
+Download page: https://commons.apache.org/dbcp/download_dbcp.cgi
-----------------------------------------------------------------------------
@@ -70,13 +124,13 @@
For complete information on Apache Commons DBCP, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons DBCP website:
-http://commons.apache.org/dbcp/
+https://commons.apache.org/dbcp/
-Download from http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
+Download from https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
-----------------------------------------------------------------------------
-Download page: http://commons.apache.org/dbcp/download_dbcp.cgi
+Download page: https://commons.apache.org/dbcp/download_dbcp.cgi
Apache Apache Commons DBCP
Version 2.4.0
@@ -86,7 +140,7 @@
Apache Commons DBCP software implements Database Connection Pooling.
-This is a minor release, including bug fixes and enhancements, which you can download from http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
+This is a minor release, including bug fixes and enhancements, which you can download from https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
Changes in this version include:
@@ -112,9 +166,9 @@
For complete information on Apache Commons DBCP, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons DBCP website:
-http://commons.apache.org/dbcp/
+https://commons.apache.org/dbcp/
-Download from http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
+Download from https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
-----------------------------------------------------------------------------
@@ -145,9 +199,9 @@
For complete information on Apache Commons DBCP, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons DBCP website:
-http://commons.apache.org/dbcp/
+https://commons.apache.org/dbcp/
-Download from http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
+Download from https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
-----------------------------------------------------------------------------
@@ -209,9 +263,9 @@
For complete information on Apache Commons DBCP, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons DBCP website:
-http://commons.apache.org/dbcp/
+https://commons.apache.org/dbcp/
-Download from http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
+Download from https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
-----------------------------------------------------------------------------
@@ -244,6 +298,6 @@
For complete information on Apache Commons DBCP, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons DBCP website:
-http://commons.apache.org/dbcp/
+https://commons.apache.org/dbcp/
-Download from http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
+Download from https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
diff -Nru commons-dbcp2-2.6.0/src/changes/changes.xml commons-dbcp2-2.7.0/src/changes/changes.xml
--- commons-dbcp2-2.6.0/src/changes/changes.xml 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/changes/changes.xml 2019-07-31 12:46:24.000000000 +0000
@@ -1,1006 +1,1087 @@
-
-
-
-
-
-
-
- Commons DBCP Release Notes
-
-
-
-
-
-
- Allow for manual connection eviction.
-
-
- Allow DBCP to register with a TransactionSynchronizationRegistry for XA cases.
-
-
- Make defensive copies of char[] passwords.
-
-
- Do not try to register synchronization when the transaction is no longer active.
-
-
- Do not double returnObject back to the pool if there is a transaction context with a shared connection.
-
-
- Allow DBCP to work with old Java 6/JDBC drivers without throwing AbstractMethodError.
-
-
- Add some toString() methods for debugging (never printing passwords.)
-
-
- BasicManagedDataSource needs to pass the TSR with creating DataSourceXAConnectionFactory.
-
-
- Add getters to some classes.
-
-
- org.apache.commons.dbcp2.DriverManagerConnectionFactory should use a char[] instead of a String to store passwords.
-
-
- Update Apache Commons Pool from 2.6.0 to 2.6.1.
-
-
-
-
- Update Java requirement from version 7 to 8.
-
-
- Support JDBC 4.2.
-
-
- Support default schema in configuration.
-
-
- Examines 'SQLException's thrown by underlying connections or statements for fatal (disconnection) errors.
-
-
- Change default for fail-fast connections from false to true.
-
-
- Prepared statement keys should take a Connection's schema into account.
-
-
- Increase test coverage.
-
-
- Update Apache Commons Pool from 2.5.0 to 2.6.0.
-
-
- Avoid exceptions when closing a connection in mutli-threaded use case.
-
-
-
-
- Connection leak during XATransaction in high load.
-
-
- Drop Ant build.
-
-
- Ensure DBCP ConnectionListener can deal with transaction managers which invoke rollback in a separate thread.
-
-
- org.apache.commons.dbcp2.PStmtKey should make copies of given arrays in constructors.
-
-
- Remove duplicate code in org.apache.commons.dbcp2.cpdsadapter.PStmtKeyCPDS.
-
-
- Add support for pooling CallableStatements to the org.apache.commons.dbcp2.cpdsadapter package.
-
-
- Deprecate use of PStmtKeyCPDS in favor of PStmtKey.
-
-
- org.apache.commons.dbcp2.DataSourceConnectionFactory should use a char[] instead of a String to store passwords.
-
-
- org.apache.commons.dbcp2.managed.DataSourceXAConnectionFactory should use a char[] instead of a String to store passwords.
-
-
- org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS should use a char[] instead of a String to store passwords.
-
-
- org.apache.commons.dbcp2.datasources.CPDSConnectionFactory should use a char[] instead of a String to store passwords.
-
-
- org.apache.commons.dbcp2.datasources internals should use a char[] instead of a String to store passwords.
-
-
- org.apache.commons.dbcp2.datasources.InstanceKeyDataSourceFactory.closeAll() does not close all.
-
-
-
-
- AbandonedTrace.getTrace() contains race condition.
-
-
- Avoid javax.management.InstanceNotFoundException on shutdown when a bean is not registered. Closes #9.
-
-
- Make constant public: org.apache.commons.dbcp2.PoolingDriver.URL_PREFIX.
-
-
- DriverAdapterCPDS.setUser(), setPassword(), and getPooledConnection() with null arguments throw NullPointerExceptions when connection properties are set.
-
-
- Add API org.apache.commons.dbcp2.datasources.PerUserPoolDataSource.clear().
-
-
- NPE for org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS.setConnectionProperties(null).
-
-
- The method org.apache.commons.dbcp2.PoolingDriver.getConnectionPool(String) does not tell you which pool name is not registered when it throws an exception.
-
-
-
-
- Update Apache Commons Pool from 2.4.2 to 2.5.0.
-
-
- OSGi declarations contain multiple import headers for javax.transaction.
-
-
- Wrong parameter name in site documentation for BasicDataSource Configuration Parameters.
-
-
- Add jmxName to properties set by BasicDataSourceFactory. This
- enables container-managed pools created from JNDI Resource
- definitions to enable JMX by supplying a valid root JMX name.
-
-
- NullPointerException thrown when calling ManagedConnection.isClosed().
-
-
- InvalidateConnection can result in closed connection returned by getConnection.
-
-
- Complete the fix for DBCP-418, enabling PoolableConnection class to load in environments
- (such as GAE) where the JMX ManagementFactory is not available.
-
-
- Add constructor DriverManagerConnectionFactory(String).
-
-
- Ensure that the cacheState setting is used when statement pooling is
- disabled.
-
-
- Ensure that setSoftMinEvictableIdleTimeMillis is used when working with
- BasicDataSource.
-
-
- Correct the name of the configuration attribute
- softMinEvictableIdleTimeMillis.
-
-
- Avoid potential infinite loops when checking if an SQLException is fatal
- for a connection or not.
-
-
- Expand the fail-fast for fatal connection errors feature to include
- managed connections.
-
-
- Correct a typo in the method name
- PoolableConnectionFactory#setMaxOpenPreparedStatements. The old method
- remains but is deprecated so not to break clients currently using the
- incorrect name.
-
-
- Refactoring to prepare for a future patch to enable pooling of all
- prepared and callable statements in PoolingConnection.
-
-
- Ensure that a thread's interrupt status is visible to the caller if the
- thread is interrupted during a call to
- PoolingDataSource.getConnection().
-
-
- Make it simpler to extend BasicDataSource to allow sub-classes to
- provide custom GenericObjectPool implementations.
-
-
- When using a BasicDataSource, pass changes related to the handling of
- abandoned connections to the underlying pool so that the pool
- configuration may be updated dynamically.
-
-
- Enable pooling of all prepared and callable statements
- inPoolingConnection.
-
-
-
-
- Updated pool version to 2.4.2. The fix for POOL-300 may cause DBCP
- users to see more reports of abandoned connections (if removal and logging
- are configured). Prior to the fix for POOL-300, the PrintWriter used to log
- abandoned connection stack traces was not being flushed on each log event.
-
-
- Added BasicDataSource abandonedUsageTracking property missing from BasicDataSourceFactory.
-
-
- SharedPoolDataSource getConnection fails when testOnBorrow is set with
- a null validation query.
-
-
- Nested connections in a transaction (local) throws null pointer.
-
-
- BasicDataSource does not set disconnectionSql properties on its PoolableConnectionFactory.
-
-
-
-
- InstanceKeyDataSource discards native SQLException when given password does not match
- password used to create the connection.
-
-
- Update Apache Commons Logging to 1.2 from 1.1.3.
-
-
- Correct some Javadoc references to Apache Commons Pool 2 classes that
- have changed names since Pool 1.x.
-
-
- Do not ignore the configured custom eviction policy when creating a
- BasicDataSource.
-
-
- Added invalidateConnection method to BasicDataSource.
-
-
- Unsuccessful Connection enlistment in XA Transaction ignored by TransactionContext.
-
-
- Made expired connection logging configurable in BasicDataSource. Setting
- logExpiredConnections to false suppresses expired connection log messages.
-
-
- Made Datasources implement AutoCloseable.
-
-
- Added fastFailValidation property to PoolableConnection, configurable in
- BasicDataSource. When set to true, connections that have previously thrown
- fatal disconnection errors will fail validation immediately (no driver calls).
-
-
- Changed BasicDataSource createDataSource method to ensure that initialization
- completes before clients get reference to newly created instances.
-
-
- Fixed connection leak when SQLException is thrown while enlisting an XA
- transaction.
-
-
- Setting jmxName to null should suppress JMX registration of connection
- and statement pools.
-
-
- Eliminated synchronization in BasicDataSource getNumActive, getNumIdle methods.
-
-
- Added property name verification to BasicDataSourceFactory. References including
- obsolete or unrecognized properties now generate log messages.
-
-
-
-
- Small performance improvements when returning connections to the pool.
-
-
- Fixed DelegatingStatement close to ensure closed statements do not retain references
- to pooled prepared statements. Due to finalization code added in 2.0, this was causing
- pooled prepared statements to be closed by GC while in use by clients.
-
-
- Added check in PoolingDataSource constructor to ensure that the connection factory
- and pool are properly linked.
-
-
- Fixed connection leak when managed connections are closed during transactions.
-
-
- Enable PoolableConnection class to load without JMX.
-
-
-
-
- BasicManagedDataSource - unregister from JMX on close().
-
-
- Log validation failures of poolable connections.
-
-
- DelegatingStatement.close() fails with NPE if statement is null
-
-
- CPDSConnectionFactory.validateObject(Object) ignores Throwable.
-
-
- Provide a new option (cacheState) to cache current values of autoCommit
- and readOnly so database queries are not required for every call to the
- associated getters. This option is enabled by default.
-
-
- Removed unnecessary synchronisation in BasicDataSource#createDataSource.
-
-
- The Java package name has been changed from org.apache.commons.dbcp to
- org.apache.commons.dbcp2.
-
-
- Update to Commons Pool 2 (based on java.util.concurrent) to provide
- pooling functionality.
-
-
- Updated source code for Java 1.6 (added @Override & @Deprecated
- annotations).
-
-
- Removed JOCL support.
-
-
- Remove deprecated SQLNestedException.
-
-
- Fix threading issues with accessToUnderlyingConnectionAllowed attribute
- of PoolingDriver which is used to support unit testing.
-
-
- BasicDataSource instances are now exposed via JMX. All the configuration
- properties are available as is the connection pool and the statement
- pools (if statement pooling is enabled).
-
-
- Fix thread safety issues in the SharedPoolDataSource and the
- PerUserPoolDataSource.
-
-
- Allow accessToUnderlyingConnectionAllowed to be configured when
- configuration takes place via JNDI in a JavaEE container.
-
-
- Fix threading issue when using multiple instances of the
- SharedPoolDataSource concurrently.
-
-
- Ensure that the close state of a pooled connection and the underlying
- connection is consistent when the underlying connection is closed as a
- result of an error condition.
-
-
- Make all mutable fields private.
-
-
- Return BasicDataSource rather than DataSource from
- BasicDataSourceFactory so a cast is not required to use BasicDataSource
- specific methods.
-
-
- The equals() implementations of the DelegatingXxx classes are now
- symmetric. There are some important API changes underlying this fix.
- Firstly, two DelegatingXxx instances are no longer considered equal if
- they have the same innermost delegate. Secondly, a DelegatingXxx
- instance is not considered equal to its innermost delegate. The
- getInnermostDelegateInternal() method has been made public (but remains
- part of the internal API) to allow classes extending this implementation
- to access the innermost delegate when required.
-
-
- Expose the new Pool 2 property evictionPolicyClassName to enable more
- sophisticated eviction strategies to be used.
-
-
- Add support for pooling PreparedStatements that use auto-generated keys.
-
-
- Enable JDBC resources that are no longer referenced by client code to be
- eligible for garbage collection.
-
-
- Enable DBCP to work with a SecurityManager such that only DBCP needs to
- be granted the necessary permissions to communicate with the database.
-
-
- Correct path to Javadoc overview in build.xml.
-
-
- The default values for readOnly, autoCommit and transactionIsolation are
- now taken from the JDBC driver. No calls to setReadOnly(),
- setAutoCommit() or setTransactionIsolation() will be made for a newly
- borrowed connection unless a default is explicitly configured and the
- connection is currently using a different setting.
-
-
- Register pooled connections with JMX so that they may be forcibly closed
- via JMX if required.
-
-
- Modify SharedPoolDataSource and PerUserPoolDataSource to expose all of
- the configuration properties of the underlying connection pool(s). This
- represents a significant refactoring of these classes and a number of
- property names have changed as a result.
-
-
- Provide an option to control if autoCommit is always set to true when a
- connection is returned to the connection pool.
-
-
- Provide an option to control if rollback is called when a connection is
- returned to the poll with autoCommit disabled.
-
-
- Provide an option to set the default query timeout.
-
-
- Connection.isValid() should not throw an SQLException if the connection
- is closed.
-
-
- Use Connection.isValid() to validate connections unless a validation
- query is explicitly configured. Note that this means it is no longer
- necessary for a validation query to be specified in order for validation
- to take place. When testing with Oracle, this resulted in database
- validation being approximately 7 times faster.
-
-
- Add support for validation testing database connections on creation.
-
-
-
-
- Correct the documentation for the maxOpenPreparedStatements parameter
- and review the use of the phrase non-positive throughout the
- documentation and javadoc, replacing it with negative where that is the
- correct definition to use.
-
-
- Avoid multiple calls to Connection.getAutoCommit() in
- PoolableConnectionFactory.passivateObject() as it could be an expensive
- call.
-
-
- Use one line per statement for methods with multiple statements rather
- than using a single line.
-
-
- Expose all of the AbandonedConfig properties through a BasicDataSource.
-
-
- Correct implementation of DelegatingConnection.isWrapperFor() so it
- works correctly with older JDBC drivers.
-
-
- Correct implementation of DelegatingStatement.isWrapperFor(). Also fix
- DelegatingDatabaseMetaData.isWrapperFor() and
- DelegatingResultSet.isWrapperFor() that had the same problem.
-
-
- LocalXAConnectionFactory does not properly check if Xid is equal to
- currentXid when resuming which may result in an XAException.
-
-
- Ensure that the XAConnection is closed when the associated Connection is
- closed.
-
-
- Clarify Jaavdoc for isClosed() method of PoolableConnection.
-
-
- Avoid NullPointerException and throw an XAException if an attempt is
- made to commit the current transaction for a connection when no
- transaction has been started.
-
-
- Using batchUpdate() should not invalidate the PreparedStatement when it
- is returned to the pool.
-
-
- Improve documentation for JNDI example using BasicDataSource.
-
-
-
-
- Exposed GenericObjectPool's softMinEvictableIdleTimeMillis property for
- configuration and use by BasicDataSource.
-
-
- Made equals reflexive in DelegatingStatement (and subclasses), DelegatingMetaData,
- DelegatingResultSet and PoolingDriver#PoolGuardConnectionWrapper.
-
-
- Modified createDataSource method in BasicDataSource to ensure that GenericObjectPool
- Evictor tasks are not started and orphaned when BasicDataSource encounters errors on
- initialization. Prior to this fix, when minIdle and timeBetweenEvictionRunsMillis
- are both positive, Evictors orphaned by failed initialization can continue to
- generate database connection requests. This issue is duplicated by DBCP-339
- and DBCP-93.
-
-
- Changed DelegatingDatabaseMetaData to no longer add itself to the AbandonedTrace
- of its parent connection. This was causing excessive memory consumption and was
- not necessary, as resultsets created by DelegatingDatabaseMetaData instances are
- attached to the parent connection's trace on creation. Also fixes DBCP-352.
-
-
- Modified execute methods of Statement objects to ensure that whenever
- a statement is used, the lastUsed property of its parent connection is
- updated.
-
-
- Correctly implemented the option to configure the class loader used to load
- the JDBC driver.
-
-
- LIFO configuration option has been added to BasicDataSource. When set
- to true (the default), the pool acts as a LIFO queue; setting to false
- causes connections to enter and exit to pool in FIFO order.
-
-
- Test transitive dependencies brought in by geronimo-transaction created
- version conflicts (commons logging and junit). These have been explicitly
- excluded in the POM.
-
-
- BasicDataSourceFactory incorrectly used "initConnectSqls" in versions
- 1.3 and 1.4 of DBCP as the property name for connectionInitSqls.
- Online docs for 1.3/1/4 have been updated to reflect this inconsistency.
- The BasicDataSourceFactory property name has been changed to "connectInitSqls"
- to match the online docs and the BasicDataSource property name.
-
-
-
-
- Eliminated poolKeys cache from PerUserPoolDataSource.
-
-
- Eliminated userKeys LRUMap cache from SharedPoolDataSource.
-
-
- Made private fields final where possible.
-
-
- PerUserPoolDataSource.getPooledConnectionAndInfo multi-threading bug.
-
-
- Remove throws clause from method that does not throw an exception.
-
-
- Remove code that catches and ignores Exceptions when calling
- PooledConnection.removeConnectionEventListener(ConnectionEventListener)
- as the method does not throw any Exceptions.
-
-
- Remove impossible null check.
-
-
- Renamed variables with duplicate names in different scopes.
-
-
- Clarified javadoc for BasicDataSource close() method.
-
-
- Made PoolingConnection pool CallableStatements. When BasicDataSource's
- poolPreparedStatements property is true, CallableStatements are now
- pooled along with PreparedStatements. The maxOpenPreparedStatements
- property limits the combined number of Callable and Prepared statements
- that can be in use at a given time.
-
-
- Use an API specific exception for logging abandoned objects to make
- scanning the logs for these exceptions simpler and to provide a better
- message that includes the creation time of the abandoned object.
-
-
- Ensure Statement.getGeneratedKeys() works correctly with the CPDS
- adapter.
-
-
- Removed incorrectly advertised ClassNotFoundException from
- JOCLContentHandler.ConstructorDetails.createObject().
-
-
- Make the class loader used to load the JDBC driver configurable for the
- BasicDatasource.
-
-
- Handle user password changes for InstanceKeyDataSources.
-
-
- Made XADataSource configurable in BasicManagedDataSource.
-
-
- Added PoolableManagedConnection and PoolableManagedConnectionFactory so that
- pooled managed connections can unregister themselves from transaction registries,
- avoiding resource leaks.
-
-
- Added connectionProperties property to DriverAdapterCPDS.
-
-
- Added a validationQueryTimeout configuration parameter to BasicDataSource
- allowing the user to specify a timeout value (in seconds) for connection
- validation queries.
-
-
- Added a connectionInitSqls configuration parameter to BasicDataSource
- allowing the user to specify a collection of SQL statements to execute
- one time when a physical database connection is first opened.
-
-
- PoolableConnectionFactory.makeObject() is no longer synchronized. This
- provides improved response times when load spikes at the cost of a
- faster rise in database server load. This change was made as a partial
- fix for DBCP-212. The synchronization changes in Commons Pool 1.5 complete
- the fix for this issue.
-
-
- Reverted DelegatingConnection close to 1.2.2 version to ensure
- open statements are closed before the underlying connection is closed.
-
-
- Refactor DelegatingConnection and ManagedConnection enable overridden
- equals() and hashcode() to work correctly.
-
-
- Add a DelegatingDatabaseMetaData to track ResultSets returned from
- DatabaseMetaData objects.
-
-
- Modified BasicDataSourceFactory to complete initialization of the pool
- by creating initialSize connections rather than leaving this to lazy
- initialization when the pool is used.
-
-
- Eliminated masked _stmt field in descendents of DelegatingStatement.
-
-
- Modified DBCP sources to support compilation under JDK 1.4-1.6
- using Ant flags to do conditional compilation.
-
-
- Added a static initializer to BasicDatasource that calls
- DriverManager.getDrivers() to force initialization before we ever do
- anything that might use Class.forName() to load (and register) a JDBC
- driver.
-
-
- Eliminated direct System.out calls in AbandonedTrace.
-
-
- Modified DelegatingStatement close to clear open batches.
-
-
- Eliminated unused private "parent" field in AbandonedTrace.
-
-
- Fixed errors handling boolean-valued Reference properties in
- InstanceKeyObjectFactory, DriverAdapterCPDS that were causing
- testOnBorrow and poolPreparedStatements properties to be incorrectly
- set when creating objects from javax.naming.Reference instances.
-
-
- Made private instance fields of AbandonedTrace volatile (parent,
- createdBy, lastUsed, createdTime) or final (trace).
-
-
- Narrowed synchronization in AbandonedTrace to resolve an Evictor deadlock.
-
-
- Corrected Javadoc to state that getLoginTimeout and setLoginTimeout are
- NOT supported by BasicDataSource.
-
-
- Added Maven 2 pom.xml. Removed a block of code from TestJOCLed that set
- the Xerces parser manually. This was to support early JDKs. The 1.3
- version of DBCP requires JDK 1.4+.
-
-
- Added support for pooling managed connections.
-
-
- Added BasicManagedDataSource, extending BasicDataSource.
- Also improved extensibility of BasicDataSource by encapsulating
- methods to create object pool, connection factory and datasource
- instance previously embedded in createDataSource.
-
-
- Changed behavior to allow Connection, Statement, PreparedStatement,
- CallableStatement and ResultSet to be closed multiple times. The first
- time close is called the resource is closed and any subsequent calls
- have no effect. This behavior is required as per the Javadocs for these
- classes. Also added tests for closing all types multiple times and
- updated any tests that incorrectly assert that a resource can not be
- closed more then once. Fixes DBCP-3, DBCP-5, DBCP-23 and DBCP-134.
-
-
- Modified PoolingDataSource, PoolingDriver and DelegatingStatement to
- assure that all returned Statements, PreparedStatements,
- CallableStatements and ResultSets are wrapped with a delegating object,
- which already properly handle the back pointers for Connection and
- Statement. Also added tests to to assure that the *same* object used
- to create the statement or result set is returned from either
- getConnection() or getStatement().
-
-
- SQLNestedException has been deprecated and will be replaced in DBCP 2.0 with
- SQLException and standard Java exception chaining.
-
-
- BasicDataSource.close() now permanently marks the data source as closed,
- and no new connections can be obtained from the data source. At close all
- idle connections are destroyed and the method returns. As the remaining
- active connections are closed, they are destroyed.
-
-
- Eliminated potential sources of NullPointerExceptions in
- PoolingConnection.
-
-
- Improved error recovery and listener cleanup in
- KeyedCPDSConnectionFactory. Substituted calls to destroyObject with
- _pool.invalidateObject on error to ensure pool active count is
- decremented on error events. Ensured that events from closed or invalid
- connections are ignored and listeners are cleaned up.
-
-
- Fixed error in SharedPoolDataSource causing incorrect passwords to be
- stored under certain conditions.
-
-
- Added exception handler to ensure that PooledConnections are not
- orphaned when an exception occurs in setUpDefaults or clearWarnings in
- InstanceKeyDataSource.getConnection.
-
-
- Made getPool synchronized in PoolableConnectionFactory.
- Fixes inconsistent synchronization accessing _pool.
-
-
- Fixed inconsistent synchronization on _rollbackAfterValidation,
- _validationQuery and _pool in CPDSConnectionFactory and
- KeyedCPDSConnectionFactory by making the first two volatile and making
- both getter and setter for _pool synchronized.
-
-
-
-
- See <a href="changes-report.html#a1.4">DBCP 1.4 Changes </a> for details. Version
- 1.3 is identical to 1.4, other than JDBC 4 methods being filtered out of the DBCP 1.3 sources. Changes
- Since 1.2.2 are the same for 1.3 and 1.4.
-
-
-
-
- Add a <i>JNDI How To</i> to the User Guide.
-
-
- DriverManagerConnectionFactory: blank user name and password handling.
-
-
- Broken behaviour for BasicDataSource.setMaxActive(0).
-
-
- BasicDataSource does not work with getConnection(String, String).
-
-
- Enhancements to prepared statement in DriverAdapterCPDS.
-
-
- Better messages and docs for LoginTimeout UnsupportedOperationException.
-
-
- Error in JOCL snippet in org.apache.commons.dbcp package javadoc.
-
-
- Added toString() methods to DelegatingPreparedStatement and DelegatingStatement
-
-
- Changes to make DBCP compile on JDK 1.5 by adding source="1.4" to compiler
- arguments (there are compiler errors in JDK 5.0 without this source switch
- that cannot be fixed without JDK 5.0-specific syntax).
-
-
- Per-user pooling with Oracle driver and default isolation settings.
-
-
- Error in JOCL document in javadoc.
-
-
- Added toString() method to DelegatingConnection.
-
-
- Add DriverManager.invalidateConnection().
-
-
- Improved Exception nesting in ConnectionPool.
-
-
- Fix broken website links for examples.
-
-
- Modified PoolableConnection close method to invalidate instance
- when invoked on an already closed connection.
-
-
- Inserted null checks to avoid NPE in close operations.
-
-
- Changed getReference method in InstanceKeyDataSource to return a
- concrete factory and added implementations of getReference in concrete
- subclasses.
-
-
- Inserted null check in close method of SharedPoolDataSource to avoid
- NPE when invoked on non-initialized pool.
-
-
- Document fact that true values for testOnBorrow, testOnReturn, testWhileIdle
- only have effect when validationQuery is set to a non-null string.
-
-
- Modified activateObject in PoolableConnection to test connection
- properties before resetting to defaults.
-
-
- Corrected maxActive documentation in configuration.html.
-
-
- Upgraded dependency to Pool 1.3.
-
-
- Added connection info to SQLException messages when closed connections
- (resp stmts) are accessed in DelegatingConnection, DelegatingStatement.
-
-
- Fixed errors in pool parameter documentation and made
- 0 value for _maxPreparedStatements in DriverAdapterCPDS behave
- like a negative value, to be consistent with documentation
- and pool behavior.
-
-
- Made userKeys an instance variable (i.e., not static)
- in SharedPoolDataSource.
-
-
- Changed implementation of equals in
- PoolingDataSource.PoolGuardConnectionWrapper
- to ensure it is reflexive, even when wrapped connections are not
- DelegatingConnections.
-
-
- Added rollbackAfterValidation property and code to issue a rollback on a
- connection after validation when this property is set to true to eliminate
- Oracle driver exceptions. Default property value is false.
-
-
- Removed dependency on Commons Collections by adding collections
- 2.1 sources for LRUMap and SequencedHashMap with package scope to
- datasources package.
-
-
- Removed synchronization from prepareStatement methods in
- PoolingConnection. Synchronization in these methods was causing
- deadlocks. No resources other than the prepared statement pool are
- accessed by these methods, and the pool methods are synchronized.
- Also fixes DBCP-202.
-
-
-
-
-
- See <a href="release-notes-1.2.1.html">DBCP 1.2.1 Release Notes</a> for details.
-
-
-
-
-
- See <a href="release-notes-1.2.html">DBCP 1.2 Release Notes</a> for details.
-
-
-
-
-
- See <a href="release-notes-1.1.html">DBCP 1.1 Release Notes</a> for details.
-
-
-
-
-
- Initial Release
-
-
-
-
-
+
+
+
+
+
+
+
+ Apache Commons DBCP Release Notes
+
+
+
+
+
+
+
+ ManagedDataSource#close() should declare used exceptions.
+
+
+ Add a ConnectionFactory class name setting for BasicDataSource.createConnectionFactory() #33.
+
+
+ Add missing Javadocs.
+
+
+
+ Wrong JMX base name derived in BasicDataSource#updateJmxName.
+
+
+ Avoid NPE when calling DriverAdapterCPDS.toString().
+
+
+ java.util.IllegalFormatException while building a message for a SQLFeatureNotSupportedException in Jdbc41Bridge.getObject(ResultSet,String,Class).
+
+
+ Fix Javadoc link in README.md #21.
+
+
+
+ Close ObjectOutputStream before calling toByteArray() on underlying ByteArrayOutputStream #28.
+
+
+ Upgrade to JUnit Jupiter #19.
+
+
+ Fix tests on Java 11.
+
+
+ Update Apache Commons Pool from 2.6.1 to 2.6.2.
+
+
+ Add 'jmxName' property to web configuration parameters listing.
+
+
+ Update Apache Commons Pool from 2.6.2 to 2.7.0.
+
+
+ Make org.apache.commons.dbcp2.AbandonedTrace.removeTrace(AbandonedTrace) null-safe.
+
+
+ org.apache.commons.dbcp2.DelegatingStatement.close() should try to close ALL of its result sets even when an exception occurs.
+
+
+ org.apache.commons.dbcp2.DelegatingConnection.passivate() should close ALL of its resources even when an exception occurs.
+
+
+ org.apache.commons.dbcp2.PoolablePreparedStatement.passivate() should close ALL of its resources even when an exception occurs.
+
+
+ org.apache.commons.dbcp2.PoolableCallableStatement.passivate() should close ALL of its resources even when an exception occurs.
+
+
+
+ Update tests from org.mockito:mockito-core 2.28.2 to 3.0.0.
+
+
+ Update tests from H2 1.4.198 to 1.4.199.
+
+
+ Update tests from com.h2database:h2 1.4.197 to 1.4.199.
+
+
+ Update tests from org.jboss.narayana.jta:narayana-jta 5.9.2.Final to 5.9.5.Final.
+
+
+ Update tests from org.jboss.logging:jboss-logging 3.3.2.Final to 3.4.0.Final.
+
+
+ Update tests from org.mockito:mockito-core 2.24.0 to 2.28.2.
+
+
+ Update tests from org.mockito:mockito-core 2.28.2 to 3.0.0.
+
+
+
+
+ Allow for manual connection eviction.
+
+
+ Allow DBCP to register with a TransactionSynchronizationRegistry for XA cases.
+
+
+ Make defensive copies of char[] passwords.
+
+
+ Do not try to register synchronization when the transaction is no longer active.
+
+
+ Do not double returnObject back to the pool if there is a transaction context with a shared connection.
+
+
+ Allow DBCP to work with old Java 6/JDBC drivers without throwing AbstractMethodError.
+
+
+ Add some toString() methods for debugging (never printing passwords.)
+
+
+ BasicManagedDataSource needs to pass the TSR with creating DataSourceXAConnectionFactory.
+
+
+ Add getters to some classes.
+
+
+ org.apache.commons.dbcp2.DriverManagerConnectionFactory should use a char[] instead of a String to store passwords.
+
+
+ Update Apache Commons Pool from 2.6.0 to 2.6.1.
+
+
+
+
+ Update Java requirement from version 7 to 8.
+
+
+ Support JDBC 4.2.
+
+
+ Support default schema in configuration.
+
+
+ Examines 'SQLException's thrown by underlying connections or statements for fatal (disconnection) errors.
+
+
+ Change default for fail-fast connections from false to true.
+
+
+ Prepared statement keys should take a Connection's schema into account.
+
+
+ Increase test coverage.
+
+
+ Update Apache Commons Pool from 2.5.0 to 2.6.0.
+
+
+ Avoid exceptions when closing a connection in mutli-threaded use case.
+
+
+
+
+ Connection leak during XATransaction in high load.
+
+
+ Drop Ant build.
+
+
+ Ensure DBCP ConnectionListener can deal with transaction managers which invoke rollback in a separate thread.
+
+
+ org.apache.commons.dbcp2.PStmtKey should make copies of given arrays in constructors.
+
+
+ Remove duplicate code in org.apache.commons.dbcp2.cpdsadapter.PStmtKeyCPDS.
+
+
+ Add support for pooling CallableStatements to the org.apache.commons.dbcp2.cpdsadapter package.
+
+
+ Deprecate use of PStmtKeyCPDS in favor of PStmtKey.
+
+
+ org.apache.commons.dbcp2.DataSourceConnectionFactory should use a char[] instead of a String to store passwords.
+
+
+ org.apache.commons.dbcp2.managed.DataSourceXAConnectionFactory should use a char[] instead of a String to store passwords.
+
+
+ org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS should use a char[] instead of a String to store passwords.
+
+
+ org.apache.commons.dbcp2.datasources.CPDSConnectionFactory should use a char[] instead of a String to store passwords.
+
+
+ org.apache.commons.dbcp2.datasources internals should use a char[] instead of a String to store passwords.
+
+
+ org.apache.commons.dbcp2.datasources.InstanceKeyDataSourceFactory.closeAll() does not close all.
+
+
+
+
+ AbandonedTrace.getTrace() contains race condition.
+
+
+ Avoid javax.management.InstanceNotFoundException on shutdown when a bean is not registered. Closes #9.
+
+
+ Make constant public: org.apache.commons.dbcp2.PoolingDriver.URL_PREFIX.
+
+
+ DriverAdapterCPDS.setUser(), setPassword(), and getPooledConnection() with null arguments throw NullPointerExceptions when connection properties are set.
+
+
+ Add API org.apache.commons.dbcp2.datasources.PerUserPoolDataSource.clear().
+
+
+ NPE for org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS.setConnectionProperties(null).
+
+
+ The method org.apache.commons.dbcp2.PoolingDriver.getConnectionPool(String) does not tell you which pool name is not registered when it throws an exception.
+
+
+
+
+ Update Apache Commons Pool from 2.4.2 to 2.5.0.
+
+
+ OSGi declarations contain multiple import headers for javax.transaction.
+
+
+ Wrong parameter name in site documentation for BasicDataSource Configuration Parameters.
+
+
+ Add jmxName to properties set by BasicDataSourceFactory. This
+ enables container-managed pools created from JNDI Resource
+ definitions to enable JMX by supplying a valid root JMX name.
+
+
+ NullPointerException thrown when calling ManagedConnection.isClosed().
+
+
+ InvalidateConnection can result in closed connection returned by getConnection.
+
+
+ Complete the fix for DBCP-418, enabling PoolableConnection class to load in environments
+ (such as GAE) where the JMX ManagementFactory is not available.
+
+
+ Add constructor DriverManagerConnectionFactory(String).
+
+
+ Ensure that the cacheState setting is used when statement pooling is
+ disabled.
+
+
+ Ensure that setSoftMinEvictableIdleTimeMillis is used when working with
+ BasicDataSource.
+
+
+ Correct the name of the configuration attribute
+ softMinEvictableIdleTimeMillis.
+
+
+ Avoid potential infinite loops when checking if an SQLException is fatal
+ for a connection or not.
+
+
+ Expand the fail-fast for fatal connection errors feature to include
+ managed connections.
+
+
+ Correct a typo in the method name
+ PoolableConnectionFactory#setMaxOpenPreparedStatements. The old method
+ remains but is deprecated so not to break clients currently using the
+ incorrect name.
+
+
+ Refactoring to prepare for a future patch to enable pooling of all
+ prepared and callable statements in PoolingConnection.
+
+
+ Ensure that a thread's interrupt status is visible to the caller if the
+ thread is interrupted during a call to
+ PoolingDataSource.getConnection().
+
+
+ Make it simpler to extend BasicDataSource to allow sub-classes to
+ provide custom GenericObjectPool implementations.
+
+
+ When using a BasicDataSource, pass changes related to the handling of
+ abandoned connections to the underlying pool so that the pool
+ configuration may be updated dynamically.
+
+
+ Enable pooling of all prepared and callable statements
+ inPoolingConnection.
+
+
+
+
+ Updated pool version to 2.4.2. The fix for POOL-300 may cause DBCP
+ users to see more reports of abandoned connections (if removal and logging
+ are configured). Prior to the fix for POOL-300, the PrintWriter used to log
+ abandoned connection stack traces was not being flushed on each log event.
+
+
+ Added BasicDataSource abandonedUsageTracking property missing from BasicDataSourceFactory.
+
+
+ SharedPoolDataSource getConnection fails when testOnBorrow is set with
+ a null validation query.
+
+
+ Nested connections in a transaction (local) throws null pointer.
+
+
+ BasicDataSource does not set disconnectionSql properties on its PoolableConnectionFactory.
+
+
+
+
+ InstanceKeyDataSource discards native SQLException when given password does not match
+ password used to create the connection.
+
+
+ Update Apache Commons Logging to 1.2 from 1.1.3.
+
+
+ Correct some Javadoc references to Apache Commons Pool 2 classes that
+ have changed names since Pool 1.x.
+
+
+ Do not ignore the configured custom eviction policy when creating a
+ BasicDataSource.
+
+
+ Added invalidateConnection method to BasicDataSource.
+
+
+ Unsuccessful Connection enlistment in XA Transaction ignored by TransactionContext.
+
+
+ Made expired connection logging configurable in BasicDataSource. Setting
+ logExpiredConnections to false suppresses expired connection log messages.
+
+
+ Made Datasources implement AutoCloseable.
+
+
+ Added fastFailValidation property to PoolableConnection, configurable in
+ BasicDataSource. When set to true, connections that have previously thrown
+ fatal disconnection errors will fail validation immediately (no driver calls).
+
+
+ Changed BasicDataSource createDataSource method to ensure that initialization
+ completes before clients get reference to newly created instances.
+
+
+ Fixed connection leak when SQLException is thrown while enlisting an XA
+ transaction.
+
+
+ Setting jmxName to null should suppress JMX registration of connection
+ and statement pools.
+
+
+ Eliminated synchronization in BasicDataSource getNumActive, getNumIdle methods.
+
+
+ Added property name verification to BasicDataSourceFactory. References including
+ obsolete or unrecognized properties now generate log messages.
+
+
+
+
+ Small performance improvements when returning connections to the pool.
+
+
+ Fixed DelegatingStatement close to ensure closed statements do not retain references
+ to pooled prepared statements. Due to finalization code added in 2.0, this was causing
+ pooled prepared statements to be closed by GC while in use by clients.
+
+
+ Added check in PoolingDataSource constructor to ensure that the connection factory
+ and pool are properly linked.
+
+
+ Fixed connection leak when managed connections are closed during transactions.
+
+
+ Enable PoolableConnection class to load without JMX.
+
+
+
+
+ BasicManagedDataSource - unregister from JMX on close().
+
+
+ Log validation failures of poolable connections.
+
+
+ DelegatingStatement.close() fails with NPE if statement is null
+
+
+ CPDSConnectionFactory.validateObject(Object) ignores Throwable.
+
+
+ Provide a new option (cacheState) to cache current values of autoCommit
+ and readOnly so database queries are not required for every call to the
+ associated getters. This option is enabled by default.
+
+
+ Removed unnecessary synchronisation in BasicDataSource#createDataSource.
+
+
+ The Java package name has been changed from org.apache.commons.dbcp to
+ org.apache.commons.dbcp2.
+
+
+ Update to Commons Pool 2 (based on java.util.concurrent) to provide
+ pooling functionality.
+
+
+ Updated source code for Java 1.6 (added @Override & @Deprecated
+ annotations).
+
+
+ Removed JOCL support.
+
+
+ Remove deprecated SQLNestedException.
+
+
+ Fix threading issues with accessToUnderlyingConnectionAllowed attribute
+ of PoolingDriver which is used to support unit testing.
+
+
+ BasicDataSource instances are now exposed via JMX. All the configuration
+ properties are available as is the connection pool and the statement
+ pools (if statement pooling is enabled).
+
+
+ Fix thread safety issues in the SharedPoolDataSource and the
+ PerUserPoolDataSource.
+
+
+ Allow accessToUnderlyingConnectionAllowed to be configured when
+ configuration takes place via JNDI in a JavaEE container.
+
+
+ Fix threading issue when using multiple instances of the
+ SharedPoolDataSource concurrently.
+
+
+ Ensure that the close state of a pooled connection and the underlying
+ connection is consistent when the underlying connection is closed as a
+ result of an error condition.
+
+
+ Make all mutable fields private.
+
+
+ Return BasicDataSource rather than DataSource from
+ BasicDataSourceFactory so a cast is not required to use BasicDataSource
+ specific methods.
+
+
+ The equals() implementations of the DelegatingXxx classes are now
+ symmetric. There are some important API changes underlying this fix.
+ Firstly, two DelegatingXxx instances are no longer considered equal if
+ they have the same innermost delegate. Secondly, a DelegatingXxx
+ instance is not considered equal to its innermost delegate. The
+ getInnermostDelegateInternal() method has been made public (but remains
+ part of the internal API) to allow classes extending this implementation
+ to access the innermost delegate when required.
+
+
+ Expose the new Pool 2 property evictionPolicyClassName to enable more
+ sophisticated eviction strategies to be used.
+
+
+ Add support for pooling PreparedStatements that use auto-generated keys.
+
+
+ Enable JDBC resources that are no longer referenced by client code to be
+ eligible for garbage collection.
+
+
+ Enable DBCP to work with a SecurityManager such that only DBCP needs to
+ be granted the necessary permissions to communicate with the database.
+
+
+ Correct path to Javadoc overview in build.xml.
+
+
+ The default values for readOnly, autoCommit and transactionIsolation are
+ now taken from the JDBC driver. No calls to setReadOnly(),
+ setAutoCommit() or setTransactionIsolation() will be made for a newly
+ borrowed connection unless a default is explicitly configured and the
+ connection is currently using a different setting.
+
+
+ Register pooled connections with JMX so that they may be forcibly closed
+ via JMX if required.
+
+
+ Modify SharedPoolDataSource and PerUserPoolDataSource to expose all of
+ the configuration properties of the underlying connection pool(s). This
+ represents a significant refactoring of these classes and a number of
+ property names have changed as a result.
+
+
+ Provide an option to control if autoCommit is always set to true when a
+ connection is returned to the connection pool.
+
+
+ Provide an option to control if rollback is called when a connection is
+ returned to the poll with autoCommit disabled.
+
+
+ Provide an option to set the default query timeout.
+
+
+ Connection.isValid() should not throw an SQLException if the connection
+ is closed.
+
+
+ Use Connection.isValid() to validate connections unless a validation
+ query is explicitly configured. Note that this means it is no longer
+ necessary for a validation query to be specified in order for validation
+ to take place. When testing with Oracle, this resulted in database
+ validation being approximately 7 times faster.
+
+
+ Add support for validation testing database connections on creation.
+
+
+
+
+ Correct the documentation for the maxOpenPreparedStatements parameter
+ and review the use of the phrase non-positive throughout the
+ documentation and javadoc, replacing it with negative where that is the
+ correct definition to use.
+
+
+ Avoid multiple calls to Connection.getAutoCommit() in
+ PoolableConnectionFactory.passivateObject() as it could be an expensive
+ call.
+
+
+ Use one line per statement for methods with multiple statements rather
+ than using a single line.
+
+
+ Expose all of the AbandonedConfig properties through a BasicDataSource.
+
+
+ Correct implementation of DelegatingConnection.isWrapperFor() so it
+ works correctly with older JDBC drivers.
+
+
+ Correct implementation of DelegatingStatement.isWrapperFor(). Also fix
+ DelegatingDatabaseMetaData.isWrapperFor() and
+ DelegatingResultSet.isWrapperFor() that had the same problem.
+
+
+ LocalXAConnectionFactory does not properly check if Xid is equal to
+ currentXid when resuming which may result in an XAException.
+
+
+ Ensure that the XAConnection is closed when the associated Connection is
+ closed.
+
+
+ Clarify Jaavdoc for isClosed() method of PoolableConnection.
+
+
+ Avoid NullPointerException and throw an XAException if an attempt is
+ made to commit the current transaction for a connection when no
+ transaction has been started.
+
+
+ Using batchUpdate() should not invalidate the PreparedStatement when it
+ is returned to the pool.
+
+
+ Improve documentation for JNDI example using BasicDataSource.
+
+
+
+
+ Exposed GenericObjectPool's softMinEvictableIdleTimeMillis property for
+ configuration and use by BasicDataSource.
+
+
+ Made equals reflexive in DelegatingStatement (and subclasses), DelegatingMetaData,
+ DelegatingResultSet and PoolingDriver#PoolGuardConnectionWrapper.
+
+
+ Modified createDataSource method in BasicDataSource to ensure that GenericObjectPool
+ Evictor tasks are not started and orphaned when BasicDataSource encounters errors on
+ initialization. Prior to this fix, when minIdle and timeBetweenEvictionRunsMillis
+ are both positive, Evictors orphaned by failed initialization can continue to
+ generate database connection requests. This issue is duplicated by DBCP-339
+ and DBCP-93.
+
+
+ Changed DelegatingDatabaseMetaData to no longer add itself to the AbandonedTrace
+ of its parent connection. This was causing excessive memory consumption and was
+ not necessary, as resultsets created by DelegatingDatabaseMetaData instances are
+ attached to the parent connection's trace on creation. Also fixes DBCP-352.
+
+
+ Modified execute methods of Statement objects to ensure that whenever
+ a statement is used, the lastUsed property of its parent connection is
+ updated.
+
+
+ Correctly implemented the option to configure the class loader used to load
+ the JDBC driver.
+
+
+ LIFO configuration option has been added to BasicDataSource. When set
+ to true (the default), the pool acts as a LIFO queue; setting to false
+ causes connections to enter and exit to pool in FIFO order.
+
+
+ Test transitive dependencies brought in by geronimo-transaction created
+ version conflicts (commons logging and junit). These have been explicitly
+ excluded in the POM.
+
+
+ BasicDataSourceFactory incorrectly used "initConnectSqls" in versions
+ 1.3 and 1.4 of DBCP as the property name for connectionInitSqls.
+ Online docs for 1.3/1/4 have been updated to reflect this inconsistency.
+ The BasicDataSourceFactory property name has been changed to "connectInitSqls"
+ to match the online docs and the BasicDataSource property name.
+
+
+
+
+ Eliminated poolKeys cache from PerUserPoolDataSource.
+
+
+ Eliminated userKeys LRUMap cache from SharedPoolDataSource.
+
+
+ Made private fields final where possible.
+
+
+ PerUserPoolDataSource.getPooledConnectionAndInfo multi-threading bug.
+
+
+ Remove throws clause from method that does not throw an exception.
+
+
+ Remove code that catches and ignores Exceptions when calling
+ PooledConnection.removeConnectionEventListener(ConnectionEventListener)
+ as the method does not throw any Exceptions.
+
+
+ Remove impossible null check.
+
+
+ Renamed variables with duplicate names in different scopes.
+
+
+ Clarified javadoc for BasicDataSource close() method.
+
+
+ Made PoolingConnection pool CallableStatements. When BasicDataSource's
+ poolPreparedStatements property is true, CallableStatements are now
+ pooled along with PreparedStatements. The maxOpenPreparedStatements
+ property limits the combined number of Callable and Prepared statements
+ that can be in use at a given time.
+
+
+ Use an API specific exception for logging abandoned objects to make
+ scanning the logs for these exceptions simpler and to provide a better
+ message that includes the creation time of the abandoned object.
+
+
+ Ensure Statement.getGeneratedKeys() works correctly with the CPDS
+ adapter.
+
+
+ Removed incorrectly advertised ClassNotFoundException from
+ JOCLContentHandler.ConstructorDetails.createObject().
+
+
+ Make the class loader used to load the JDBC driver configurable for the
+ BasicDatasource.
+
+
+ Handle user password changes for InstanceKeyDataSources.
+
+
+ Made XADataSource configurable in BasicManagedDataSource.
+
+
+ Added PoolableManagedConnection and PoolableManagedConnectionFactory so that
+ pooled managed connections can unregister themselves from transaction registries,
+ avoiding resource leaks.
+
+
+ Added connectionProperties property to DriverAdapterCPDS.
+
+
+ Added a validationQueryTimeout configuration parameter to BasicDataSource
+ allowing the user to specify a timeout value (in seconds) for connection
+ validation queries.
+
+
+ Added a connectionInitSqls configuration parameter to BasicDataSource
+ allowing the user to specify a collection of SQL statements to execute
+ one time when a physical database connection is first opened.
+
+
+ PoolableConnectionFactory.makeObject() is no longer synchronized. This
+ provides improved response times when load spikes at the cost of a
+ faster rise in database server load. This change was made as a partial
+ fix for DBCP-212. The synchronization changes in Commons Pool 1.5 complete
+ the fix for this issue.
+
+
+ Reverted DelegatingConnection close to 1.2.2 version to ensure
+ open statements are closed before the underlying connection is closed.
+
+
+ Refactor DelegatingConnection and ManagedConnection enable overridden
+ equals() and hashcode() to work correctly.
+
+
+ Add a DelegatingDatabaseMetaData to track ResultSets returned from
+ DatabaseMetaData objects.
+
+
+ Modified BasicDataSourceFactory to complete initialization of the pool
+ by creating initialSize connections rather than leaving this to lazy
+ initialization when the pool is used.
+
+
+ Eliminated masked _stmt field in descendents of DelegatingStatement.
+
+
+ Modified DBCP sources to support compilation under JDK 1.4-1.6
+ using Ant flags to do conditional compilation.
+
+
+ Added a static initializer to BasicDatasource that calls
+ DriverManager.getDrivers() to force initialization before we ever do
+ anything that might use Class.forName() to load (and register) a JDBC
+ driver.
+
+
+ Eliminated direct System.out calls in AbandonedTrace.
+
+
+ Modified DelegatingStatement close to clear open batches.
+
+
+ Eliminated unused private "parent" field in AbandonedTrace.
+
+
+ Fixed errors handling boolean-valued Reference properties in
+ InstanceKeyObjectFactory, DriverAdapterCPDS that were causing
+ testOnBorrow and poolPreparedStatements properties to be incorrectly
+ set when creating objects from javax.naming.Reference instances.
+
+
+ Made private instance fields of AbandonedTrace volatile (parent,
+ createdBy, lastUsed, createdTime) or final (trace).
+
+
+ Narrowed synchronization in AbandonedTrace to resolve an Evictor deadlock.
+
+
+ Corrected Javadoc to state that getLoginTimeout and setLoginTimeout are
+ NOT supported by BasicDataSource.
+
+
+ Added Maven 2 pom.xml. Removed a block of code from TestJOCLed that set
+ the Xerces parser manually. This was to support early JDKs. The 1.3
+ version of DBCP requires JDK 1.4+.
+
+
+ Added support for pooling managed connections.
+
+
+ Added BasicManagedDataSource, extending BasicDataSource.
+ Also improved extensibility of BasicDataSource by encapsulating
+ methods to create object pool, connection factory and datasource
+ instance previously embedded in createDataSource.
+
+
+ Changed behavior to allow Connection, Statement, PreparedStatement,
+ CallableStatement and ResultSet to be closed multiple times. The first
+ time close is called the resource is closed and any subsequent calls
+ have no effect. This behavior is required as per the Javadocs for these
+ classes. Also added tests for closing all types multiple times and
+ updated any tests that incorrectly assert that a resource can not be
+ closed more then once. Fixes DBCP-3, DBCP-5, DBCP-23 and DBCP-134.
+
+
+ Modified PoolingDataSource, PoolingDriver and DelegatingStatement to
+ assure that all returned Statements, PreparedStatements,
+ CallableStatements and ResultSets are wrapped with a delegating object,
+ which already properly handle the back pointers for Connection and
+ Statement. Also added tests to to assure that the *same* object used
+ to create the statement or result set is returned from either
+ getConnection() or getStatement().
+
+
+ SQLNestedException has been deprecated and will be replaced in DBCP 2.0 with
+ SQLException and standard Java exception chaining.
+
+
+ BasicDataSource.close() now permanently marks the data source as closed,
+ and no new connections can be obtained from the data source. At close all
+ idle connections are destroyed and the method returns. As the remaining
+ active connections are closed, they are destroyed.
+
+
+ Eliminated potential sources of NullPointerExceptions in
+ PoolingConnection.
+
+
+ Improved error recovery and listener cleanup in
+ KeyedCPDSConnectionFactory. Substituted calls to destroyObject with
+ _pool.invalidateObject on error to ensure pool active count is
+ decremented on error events. Ensured that events from closed or invalid
+ connections are ignored and listeners are cleaned up.
+
+
+ Fixed error in SharedPoolDataSource causing incorrect passwords to be
+ stored under certain conditions.
+
+
+ Added exception handler to ensure that PooledConnections are not
+ orphaned when an exception occurs in setUpDefaults or clearWarnings in
+ InstanceKeyDataSource.getConnection.
+
+
+ Made getPool synchronized in PoolableConnectionFactory.
+ Fixes inconsistent synchronization accessing _pool.
+
+
+ Fixed inconsistent synchronization on _rollbackAfterValidation,
+ _validationQuery and _pool in CPDSConnectionFactory and
+ KeyedCPDSConnectionFactory by making the first two volatile and making
+ both getter and setter for _pool synchronized.
+
+
+
+
+ See <a href="changes-report.html#a1.4">DBCP 1.4 Changes </a> for details. Version
+ 1.3 is identical to 1.4, other than JDBC 4 methods being filtered out of the DBCP 1.3 sources. Changes
+ Since 1.2.2 are the same for 1.3 and 1.4.
+
+
+
+
+ Add a <i>JNDI How To</i> to the User Guide.
+
+
+ DriverManagerConnectionFactory: blank user name and password handling.
+
+
+ Broken behaviour for BasicDataSource.setMaxActive(0).
+
+
+ BasicDataSource does not work with getConnection(String, String).
+
+
+ Enhancements to prepared statement in DriverAdapterCPDS.
+
+
+ Better messages and docs for LoginTimeout UnsupportedOperationException.
+
+
+ Error in JOCL snippet in org.apache.commons.dbcp package javadoc.
+
+
+ Added toString() methods to DelegatingPreparedStatement and DelegatingStatement
+
+
+ Changes to make DBCP compile on JDK 1.5 by adding source="1.4" to compiler
+ arguments (there are compiler errors in JDK 5.0 without this source switch
+ that cannot be fixed without JDK 5.0-specific syntax).
+
+
+ Per-user pooling with Oracle driver and default isolation settings.
+
+
+ Error in JOCL document in javadoc.
+
+
+ Added toString() method to DelegatingConnection.
+
+
+ Add DriverManager.invalidateConnection().
+
+
+ Improved Exception nesting in ConnectionPool.
+
+
+ Fix broken website links for examples.
+
+
+ Modified PoolableConnection close method to invalidate instance
+ when invoked on an already closed connection.
+
+
+ Inserted null checks to avoid NPE in close operations.
+
+
+ Changed getReference method in InstanceKeyDataSource to return a
+ concrete factory and added implementations of getReference in concrete
+ subclasses.
+
+
+ Inserted null check in close method of SharedPoolDataSource to avoid
+ NPE when invoked on non-initialized pool.
+
+
+ Document fact that true values for testOnBorrow, testOnReturn, testWhileIdle
+ only have effect when validationQuery is set to a non-null string.
+
+
+ Modified activateObject in PoolableConnection to test connection
+ properties before resetting to defaults.
+
+
+ Corrected maxActive documentation in configuration.html.
+
+
+ Upgraded dependency to Pool 1.3.
+
+
+ Added connection info to SQLException messages when closed connections
+ (resp stmts) are accessed in DelegatingConnection, DelegatingStatement.
+
+
+ Fixed errors in pool parameter documentation and made
+ 0 value for _maxPreparedStatements in DriverAdapterCPDS behave
+ like a negative value, to be consistent with documentation
+ and pool behavior.
+
+
+ Made userKeys an instance variable (i.e., not static)
+ in SharedPoolDataSource.
+
+
+ Changed implementation of equals in
+ PoolingDataSource.PoolGuardConnectionWrapper
+ to ensure it is reflexive, even when wrapped connections are not
+ DelegatingConnections.
+
+
+ Added rollbackAfterValidation property and code to issue a rollback on a
+ connection after validation when this property is set to true to eliminate
+ Oracle driver exceptions. Default property value is false.
+
+
+ Removed dependency on Commons Collections by adding collections
+ 2.1 sources for LRUMap and SequencedHashMap with package scope to
+ datasources package.
+
+
+ Removed synchronization from prepareStatement methods in
+ PoolingConnection. Synchronization in these methods was causing
+ deadlocks. No resources other than the prepared statement pool are
+ accessed by these methods, and the pool methods are synchronized.
+ Also fixes DBCP-202.
+
+
+
+
+
+ See <a href="release-notes-1.2.1.html">DBCP 1.2.1 Release Notes</a> for details.
+
+
+
+
+
+ See <a href="release-notes-1.2.html">DBCP 1.2 Release Notes</a> for details.
+
+
+
+
+
+ See <a href="release-notes-1.1.html">DBCP 1.1 Release Notes</a> for details.
+
+
+
+
+
+ Initial Release
+
+
+
+
+
diff -Nru commons-dbcp2-2.6.0/src/conf/eclipse/formatter.xml commons-dbcp2-2.7.0/src/conf/eclipse/formatter.xml
--- commons-dbcp2-2.6.0/src/conf/eclipse/formatter.xml 1970-01-01 00:00:00.000000000 +0000
+++ commons-dbcp2-2.7.0/src/conf/eclipse/formatter.xml 2019-07-31 12:46:24.000000000 +0000
@@ -0,0 +1,370 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/AbandonedTrace.java 2019-07-31 12:46:24.000000000 +0000
@@ -155,7 +155,7 @@
final Iterator> iter = traceList.iterator();
while (iter.hasNext()) {
final AbandonedTrace traceInList = iter.next().get();
- if (trace.equals(traceInList)) {
+ if (trace != null && trace.equals(traceInList)) {
iter.remove();
break;
} else if (traceInList == null) {
@@ -165,4 +165,16 @@
}
}
}
+
+ /**
+ * Removes this object the source object is tracing.
+ *
+ * @param source The object tracing
+ * @since 2.7.0
+ */
+ protected void removeThisTrace(final Object source) {
+ if (source instanceof AbandonedTrace) {
+ AbandonedTrace.class.cast(source).removeTrace(this);
+ }
+ }
}
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java 2019-07-31 12:46:24.000000000 +0000
@@ -87,6 +87,7 @@
private static final String PROP_VALIDATION_QUERY = "validationQuery";
private static final String PROP_VALIDATION_QUERY_TIMEOUT = "validationQueryTimeout";
private static final String PROP_JMX_NAME = "jmxName";
+ private static final String PROP_CONNECTION_FACTORY_CLASS_NAME = "connectionFactoryClassName";
/**
* The property name for connectionInitSqls. The associated value String must be of the form [query;]*
@@ -141,7 +142,8 @@
PROP_REMOVE_ABANDONED_TIMEOUT, PROP_LOG_ABANDONED, PROP_ABANDONED_USAGE_TRACKING, PROP_POOL_PREPARED_STATEMENTS,
PROP_MAX_OPEN_PREPARED_STATEMENTS, PROP_CONNECTION_PROPERTIES, PROP_MAX_CONN_LIFETIME_MILLIS,
PROP_LOG_EXPIRED_CONNECTIONS, PROP_ROLLBACK_ON_RETURN, PROP_ENABLE_AUTO_COMMIT_ON_RETURN,
- PROP_DEFAULT_QUERY_TIMEOUT, PROP_FAST_FAIL_VALIDATION, PROP_DISCONNECTION_SQL_CODES, PROP_JMX_NAME };
+ PROP_DEFAULT_QUERY_TIMEOUT, PROP_FAST_FAIL_VALIDATION, PROP_DISCONNECTION_SQL_CODES, PROP_JMX_NAME,
+ PROP_CONNECTION_FACTORY_CLASS_NAME };
/**
* Obsolete properties from DBCP 1.x. with warning strings suggesting new properties. LinkedHashMap will guarantee
@@ -548,6 +550,11 @@
dataSource.setDisconnectionSqlCodes(parseList(value, ','));
}
+ value = properties.getProperty(PROP_CONNECTION_FACTORY_CLASS_NAME);
+ if (value != null) {
+ dataSource.setConnectionFactoryClassName(value);
+ }
+
// DBCP-215
// Trick to make sure that initialSize connections are created
if (dataSource.getInitialSize() > 0) {
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java 2019-07-31 12:46:24.000000000 +0000
@@ -76,8 +76,6 @@
private static final Log log = LogFactory.getLog(BasicDataSource.class);
- // ------------------------------------------------------------- Properties
-
static {
// Attempt to prevent deadlocks - see DBCP - 272
DriverManager.getDrivers();
@@ -108,6 +106,7 @@
}
}
+ @SuppressWarnings("resource")
protected static void validateConnectionFactory(final PoolableConnectionFactory connectionFactory)
throws Exception {
PoolableConnection conn = null;
@@ -315,6 +314,11 @@
private volatile int validationQueryTimeoutSeconds = -1;
/**
+ * The fully qualified Java class name of a {@link ConnectionFactory} implementation.
+ */
+ private String connectionFactoryClassName;
+
+ /**
* These SQL statements run once after a Connection is created.
*
* This property can be used for example to run ALTER SESSION SET NLS_SORT=XCYECH in an Oracle Database only once
@@ -380,10 +384,8 @@
* be called before the first connection is retrieved (along with all the other configuration property setters).
* Calls to this method after the connection pool has been initialized have no effect.
*
- * @param name
- * Name of the custom connection property
- * @param value
- * Value of the custom connection property
+ * @param name Name of the custom connection property
+ * @param value Value of the custom connection property
*/
public void addConnectionProperty(final String name, final String value) {
connectionProperties.put(name, value);
@@ -408,8 +410,7 @@
* exceptions.
*
*
- * @throws SQLException
- * if an error occurs closing idle connections
+ * @throws SQLException if an error occurs closing idle connections
*/
@Override
public synchronized void close() throws SQLException {
@@ -418,12 +419,12 @@
registeredJmxObjectName = null;
}
closed = true;
- final GenericObjectPool> oldpool = connectionPool;
+ final GenericObjectPool> oldPool = connectionPool;
connectionPool = null;
dataSource = null;
try {
- if (oldpool != null) {
- oldpool.close();
+ if (oldPool != null) {
+ oldPool.close();
}
} catch (final RuntimeException e) {
throw e;
@@ -448,7 +449,7 @@
}
/**
- * Creates a JDBC connection factory for this datasource. The JDBC driver is loaded using the following algorithm:
+ * Creates a JDBC connection factory for this data source. The JDBC driver is loaded using the following algorithm:
*
*
If a Driver instance has been specified via {@link #setDriver(Driver)} use it
*
If no Driver instance was specified and {@link #driverClassName} is specified that class is loaded using the
@@ -458,77 +459,17 @@
* context class loader of the current thread.
*
If a driver still isn't loaded one is loaded via the {@link DriverManager} using the specified {@link #url}.
*
+ *
* This method exists so subclasses can replace the implementation class.
+ *
*
* @return A new connection factory.
*
- * @throws SQLException
- * If the connection factort cannot be created
+ * @throws SQLException If the connection factort cannot be created
*/
protected ConnectionFactory createConnectionFactory() throws SQLException {
// Load the JDBC driver class
- Driver driverToUse = this.driver;
-
- if (driverToUse == null) {
- Class> driverFromCCL = null;
- if (driverClassName != null) {
- try {
- try {
- if (driverClassLoader == null) {
- driverFromCCL = Class.forName(driverClassName);
- } else {
- driverFromCCL = Class.forName(driverClassName, true, driverClassLoader);
- }
- } catch (final ClassNotFoundException cnfe) {
- driverFromCCL = Thread.currentThread().getContextClassLoader().loadClass(driverClassName);
- }
- } catch (final Exception t) {
- final String message = "Cannot load JDBC driver class '" + driverClassName + "'";
- logWriter.println(message);
- t.printStackTrace(logWriter);
- throw new SQLException(message, t);
- }
- }
-
- try {
- if (driverFromCCL == null) {
- driverToUse = DriverManager.getDriver(url);
- } else {
- // Usage of DriverManager is not possible, as it does not
- // respect the ContextClassLoader
- // N.B. This cast may cause ClassCastException which is handled below
- driverToUse = (Driver) driverFromCCL.getConstructor().newInstance();
- if (!driverToUse.acceptsURL(url)) {
- throw new SQLException("No suitable driver", "08001");
- }
- }
- } catch (final Exception t) {
- final String message = "Cannot create JDBC driver of class '"
- + (driverClassName != null ? driverClassName : "") + "' for connect URL '" + url + "'";
- logWriter.println(message);
- t.printStackTrace(logWriter);
- throw new SQLException(message, t);
- }
- }
-
- // Set up the driver connection factory we will use
- final String user = userName;
- if (user != null) {
- connectionProperties.put("user", user);
- } else {
- log("DBCP DataSource configured without a 'username'");
- }
-
- final String pwd = password;
- if (pwd != null) {
- connectionProperties.put("password", pwd);
- } else {
- log("DBCP DataSource configured without a 'password'");
- }
-
- final ConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driverToUse, url,
- connectionProperties);
- return driverConnectionFactory;
+ return ConnectionFactoryFactory.createConnectionFactory(this, DriverFactory.createDriver(this));
}
/**
@@ -540,8 +481,7 @@
* positive value causes {@link GenericObjectPool}'s eviction timer to be started.
*
*
- * @param factory
- * The factory to use to create new connections for this pool.
+ * @param factory The factory to use to create new connections for this pool.
*/
protected void createConnectionPool(final PoolableConnectionFactory factory) {
// Create an object pool to contain our active connections
@@ -574,8 +514,7 @@
*
*
* @return The current internal DataSource or a newly created instance if it has not yet been created.
- * @throws SQLException
- * if the object pool cannot be created.
+ * @throws SQLException if the object pool cannot be created.
*/
protected DataSource createDataSource() throws SQLException {
if (closed) {
@@ -648,7 +587,8 @@
throw new SQLException("Error preloading the connection pool", e);
}
- // If timeBetweenEvictionRunsMillis > 0, start the pool's evictor task
+ // If timeBetweenEvictionRunsMillis > 0, start the pool's evictor
+ // task
startPoolMaintenance();
dataSource = newDataSource;
@@ -660,8 +600,7 @@
* Creates the actual data source instance. This method only exists so that subclasses can replace the
* implementation class.
*
- * @throws SQLException
- * if unable to create a datasource instance
+ * @throws SQLException if unable to create a datasource instance
*
* @return A new DataSource instance
*/
@@ -674,12 +613,9 @@
/**
* Creates an object pool used to provide pooling support for {@link Connection JDBC connections}.
*
- * @param factory
- * the object factory
- * @param poolConfig
- * the object pool configuration
- * @param abandonedConfig
- * the abandoned objects configuration
+ * @param factory the object factory
+ * @param poolConfig the object pool configuration
+ * @param abandonedConfig the abandoned objects configuration
* @return a non-null instance
*/
protected GenericObjectPool createObjectPool(final PoolableConnectionFactory factory,
@@ -698,10 +634,8 @@
* Creates the PoolableConnectionFactory and attaches it to the connection pool. This method only exists so
* subclasses can replace the default implementation.
*
- * @param driverConnectionFactory
- * JDBC connection factory
- * @throws SQLException
- * if an error occurs creating the PoolableConnectionFactory
+ * @param driverConnectionFactory JDBC connection factory
+ * @throws SQLException if an error occurs creating the PoolableConnectionFactory
*
* @return A new PoolableConnectionFactory configured with the current configuration of this BasicDataSource
*/
@@ -738,6 +672,17 @@
}
/**
+ * Manually evicts idle connections
+ *
+ * @throws Exception when there is a problem evicting idle objects.
+ */
+ public void evict() throws Exception {
+ if (connectionPool != null) {
+ connectionPool.evict();
+ }
+ }
+
+ /**
* Gets the print writer used by this configuration to log information on abandoned objects.
*
* @return The print writer used by this configuration to log information on abandoned objects.
@@ -788,8 +733,7 @@
/**
* Creates (if necessary) and return a connection to the database.
*
- * @throws SQLException
- * if a database access error occurs
+ * @throws SQLException if a database access error occurs
* @return a database connection
*/
@Override
@@ -812,24 +756,34 @@
/**
* BasicDataSource does NOT support this method.
*
- * @param user
- * Database user on whose behalf the Connection is being made
- * @param pass
- * The database user's password
- *
- * @throws UnsupportedOperationException
- * always thrown.
- * @throws SQLException
- * if a database access error occurs
+ * @param user Database user on whose behalf the Connection is being made
+ * @param pass The database user's password
+ *
+ * @throws UnsupportedOperationException always thrown.
+ * @throws SQLException if a database access error occurs
* @return nothing - always throws UnsupportedOperationException
*/
@Override
public Connection getConnection(final String user, final String pass) throws SQLException {
- // This method isn't supported by the PoolingDataSource returned by the createDataSource
+ // This method isn't supported by the PoolingDataSource returned by the
+ // createDataSource
throw new UnsupportedOperationException("Not supported by BasicDataSource");
}
/**
+ * Returns the ConnectionFactoryClassName that has been configured for use by this pool.
+ *
+ * Note: This getter only returns the last value set by a call to {@link #setConnectionFactoryClassName(String)}.
+ *
+ *
+ * @return the ConnectionFactoryClassName that has been configured for use by this pool.
+ * @since 2.7.0
+ */
+ public String getConnectionFactoryClassName() {
+ return this.connectionFactoryClassName;
+ }
+
+ /**
* Returns the list of SQL statements executed when a physical connection is first created. Returns an empty list if
* there are no initialization statements configured.
*
@@ -856,7 +810,6 @@
return connectionPool;
}
- // For unit testing
Properties getConnectionProperties() {
return connectionProperties;
}
@@ -1096,15 +1049,15 @@
* Calls {@link #createDataSource()}, so has the side effect of initializing the connection pool.
*
*
- * @throws SQLException
- * if a database access error occurs
- * @throws UnsupportedOperationException
- * If the DataSource implementation does not support the login timeout feature.
+ * @throws SQLException if a database access error occurs
+ * @throws UnsupportedOperationException If the DataSource implementation does not support the login timeout
+ * feature.
* @return login timeout in seconds
*/
@Override
public int getLoginTimeout() throws SQLException {
- // This method isn't supported by the PoolingDataSource returned by the createDataSource
+ // This method isn't supported by the PoolingDataSource returned by the
+ // createDataSource
throw new UnsupportedOperationException("Not supported by BasicDataSource");
}
@@ -1116,8 +1069,7 @@
* Calls {@link #createDataSource()}, so has the side effect of initializing the connection pool.
*
*
- * @throws SQLException
- * if a database access error occurs
+ * @throws SQLException if a database access error occurs
* @return log writer in use
*/
@Override
@@ -1485,13 +1437,12 @@
* Manually invalidates a connection, effectively requesting the pool to try to close it, remove it from the pool
* and reclaim pool capacity.
*
- * @param connection
- * The Connection to invalidate.
+ * @param connection The Connection to invalidate.
*
- * @throws IllegalStateException
- * if invalidating the connection failed.
+ * @throws IllegalStateException if invalidating the connection failed.
* @since 2.1
*/
+ @SuppressWarnings("resource")
public void invalidateConnection(final Connection connection) throws IllegalStateException {
if (connection == null) {
return;
@@ -1519,15 +1470,6 @@
}
/**
- * Manually evicts idle connections
- */
- public void evict() throws Exception {
- if (connectionPool != null) {
- connectionPool.evict();
- }
- }
-
- /**
* Returns the value of the accessToUnderlyingConnectionAllowed property.
*
* @return true if access to the underlying connection is allowed, false otherwise.
@@ -1538,7 +1480,7 @@
}
/**
- * If true, this data source is closed and no more connections can be retrieved from this datasource.
+ * If true, this data source is closed and no more connections can be retrieved from this data source.
*
* @return true, if the data source is closed; false otherwise
*/
@@ -1548,6 +1490,16 @@
}
/**
+ * Delegates in a null-safe manner to {@link String#isEmpty()}.
+ *
+ * @param value the string to test, may be null.
+ * @return boolean false if value is null, otherwise {@link String#isEmpty()}.
+ */
+ private boolean isEmpty(String value) {
+ return value == null ? true : value.trim().isEmpty();
+ }
+
+ /**
* Returns true if we are pooling statements.
*
* @return true if prepared and callable statements are pooled
@@ -1585,6 +1537,20 @@
}
}
+ /**
+ * Logs the given throwable.
+ * @param message TODO
+ * @param throwable the throwable.
+ *
+ * @since 2.7.0
+ */
+ protected void log(String message, Throwable throwable) {
+ if (logWriter != null) {
+ logWriter.println(message);
+ throwable.printStackTrace(logWriter);
+ }
+ }
+
@Override
public void postDeregister() {
// NO-OP
@@ -1619,8 +1585,7 @@
/**
* Removes a custom connection property.
*
- * @param name
- * Name of the custom connection property to remove
+ * @param name Name of the custom connection property to remove
* @see #addConnectionProperty(String, String)
*/
public void removeConnectionProperty(final String name) {
@@ -1630,8 +1595,7 @@
/**
* Sets the print writer to be used by this configuration to log information on abandoned objects.
*
- * @param logWriter
- * The new log writer
+ * @param logWriter The new log writer
*/
public void setAbandonedLogWriter(final PrintWriter logWriter) {
if (abandonedConfig == null) {
@@ -1649,9 +1613,8 @@
* the connection pool should record a stack trace every time a method is called on a pooled connection and retain
* the most recent stack trace to aid debugging of abandoned connections.
*
- * @param usageTracking
- * A value of true will enable the recording of a stack trace on every use of a pooled
- * connection
+ * @param usageTracking A value of true will enable the recording of a stack trace on every use of a
+ * pooled connection
*/
public void setAbandonedUsageTracking(final boolean usageTracking) {
if (abandonedConfig == null) {
@@ -1675,8 +1638,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param allow
- * Access to the underlying connection is granted when true.
+ * @param allow Access to the underlying connection is granted when true.
*/
public synchronized void setAccessToUnderlyingConnectionAllowed(final boolean allow) {
this.accessToUnderlyingConnectionAllowed = allow;
@@ -1687,25 +1649,40 @@
* and configured with {@link Connection#setAutoCommit(boolean) Connection.setAutoCommit(true)} if the auto commit
* setting is {@code false} when the connection is returned. It is true by default.
*
- * @param autoCommitOnReturn
- * Whether or not connections being returned to the pool will be checked and configured with auto-commit.
+ * @param autoCommitOnReturn Whether or not connections being returned to the pool will be checked and configured
+ * with auto-commit.
* @since 2.6.0
*/
public void setAutoCommitOnReturn(final boolean autoCommitOnReturn) {
this.autoCommitOnReturn = autoCommitOnReturn;
}
+ // ----------------------------------------------------- DataSource Methods
+
/**
* Sets the state caching flag.
*
- * @param cacheState
- * The new value for the state caching flag
+ * @param cacheState The new value for the state caching flag
*/
public void setCacheState(final boolean cacheState) {
this.cacheState = cacheState;
}
/**
+ * Sets the ConnectionFactory class name.
+ *
+ * @param connectionFactoryClassName A class name.
+ * @since 2.7.0
+ */
+ public void setConnectionFactoryClassName(final String connectionFactoryClassName) {
+ if (isEmpty(connectionFactoryClassName)) {
+ this.connectionFactoryClassName = null;
+ } else {
+ this.connectionFactoryClassName = connectionFactoryClassName;
+ }
+ }
+
+ /**
* Sets the list of SQL statements to be executed when a physical connection is first created.
*
* Note: this method currently has no effect once the pool has been initialized. The pool is initialized the first
@@ -1713,14 +1690,13 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param connectionInitSqls
- * Collection of SQL statements to execute on connection creation
+ * @param connectionInitSqls Collection of SQL statements to execute on connection creation
*/
public void setConnectionInitSqls(final Collection connectionInitSqls) {
if (connectionInitSqls != null && connectionInitSqls.size() > 0) {
ArrayList newVal = null;
for (final String s : connectionInitSqls) {
- if (s != null && s.trim().length() > 0) {
+ if (!isEmpty(s)) {
if (newVal == null) {
newVal = new ArrayList<>();
}
@@ -1733,8 +1709,6 @@
}
}
- // ----------------------------------------------------- DataSource Methods
-
/**
* Sets the connection properties passed to driver.connect(...).
*
@@ -1744,8 +1718,7 @@
* NOTE - The "user" and "password" properties will be added explicitly, so they do not need to be included here.
*
*
- * @param connectionProperties
- * the connection properties used to create new connections
+ * @param connectionProperties the connection properties used to create new connections
*/
public void setConnectionProperties(final String connectionProperties) {
Objects.requireNonNull(connectionProperties, "connectionProperties is null");
@@ -1759,7 +1732,8 @@
final String value = entry.substring(index + 1);
properties.setProperty(name, value);
} else {
- // no value is empty string which is how java.util.Properties works
+ // no value is empty string which is how
+ // java.util.Properties works
properties.setProperty(entry, "");
}
}
@@ -1777,8 +1751,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param defaultAutoCommit
- * default auto-commit value
+ * @param defaultAutoCommit default auto-commit value
*/
public void setDefaultAutoCommit(final Boolean defaultAutoCommit) {
this.defaultAutoCommit = defaultAutoCommit;
@@ -1794,14 +1767,13 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param defaultCatalog
- * the default catalog
+ * @param defaultCatalog the default catalog
*/
public void setDefaultCatalog(final String defaultCatalog) {
- if (defaultCatalog != null && defaultCatalog.trim().length() > 0) {
- this.defaultCatalog = defaultCatalog;
- } else {
+ if (isEmpty(defaultCatalog)) {
this.defaultCatalog = null;
+ } else {
+ this.defaultCatalog = defaultCatalog;
}
}
@@ -1809,8 +1781,7 @@
* Sets the default query timeout that will be used for {@link java.sql.Statement Statement}s created from this
* connection. null means that the driver default will be used.
*
- * @param defaultQueryTimeoutSeconds
- * The default query timeout in seconds.
+ * @param defaultQueryTimeoutSeconds The default query timeout in seconds.
*/
public void setDefaultQueryTimeout(final Integer defaultQueryTimeoutSeconds) {
this.defaultQueryTimeoutSeconds = defaultQueryTimeoutSeconds;
@@ -1826,8 +1797,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param defaultReadOnly
- * default read-only value
+ * @param defaultReadOnly default read-only value
*/
public void setDefaultReadOnly(final Boolean defaultReadOnly) {
this.defaultReadOnly = defaultReadOnly;
@@ -1843,15 +1813,14 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param defaultSchema
- * the default catalog
+ * @param defaultSchema the default catalog
* @since 2.5.0
*/
public void setDefaultSchema(final String defaultSchema) {
- if (defaultSchema != null && defaultSchema.trim().length() > 0) {
- this.defaultSchema = defaultSchema;
- } else {
+ if (isEmpty(defaultSchema)) {
this.defaultSchema = null;
+ } else {
+ this.defaultSchema = defaultSchema;
}
}
@@ -1865,8 +1834,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param defaultTransactionIsolation
- * the default transaction isolation state
+ * @param defaultTransactionIsolation the default transaction isolation state
* @see Connection#getTransactionIsolation
*/
public void setDefaultTransactionIsolation(final int defaultTransactionIsolation) {
@@ -1891,15 +1859,14 @@
* setLoginTimeout, getLoginTimeout, getLogWriter}.
*
*
- * @param disconnectionSqlCodes
- * SQL_STATE codes considered to signal fatal conditions
+ * @param disconnectionSqlCodes SQL_STATE codes considered to signal fatal conditions
* @since 2.1
*/
public void setDisconnectionSqlCodes(final Collection disconnectionSqlCodes) {
if (disconnectionSqlCodes != null && disconnectionSqlCodes.size() > 0) {
HashSet newVal = null;
for (final String s : disconnectionSqlCodes) {
- if (s != null && s.trim().length() > 0) {
+ if (!isEmpty(s)) {
if (newVal == null) {
newVal = new HashSet<>();
}
@@ -1920,8 +1887,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param driver
- * The JDBC Driver instance to use for this pool.
+ * @param driver The JDBC Driver instance to use for this pool.
*/
public synchronized void setDriver(final Driver driver) {
this.driver = driver;
@@ -1937,8 +1903,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param driverClassLoader
- * the class loader with which to load the JDBC driver
+ * @param driverClassLoader the class loader with which to load the JDBC driver
*/
public synchronized void setDriverClassLoader(final ClassLoader driverClassLoader) {
this.driverClassLoader = driverClassLoader;
@@ -1954,14 +1919,13 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param driverClassName
- * the class name of the JDBC driver
+ * @param driverClassName the class name of the JDBC driver
*/
public synchronized void setDriverClassName(final String driverClassName) {
- if (driverClassName != null && driverClassName.trim().length() > 0) {
- this.driverClassName = driverClassName;
- } else {
+ if (isEmpty(driverClassName)) {
this.driverClassName = null;
+ } else {
+ this.driverClassName = driverClassName;
}
}
@@ -1970,8 +1934,8 @@
* and configured with {@link Connection#setAutoCommit(boolean) Connection.setAutoCommit(true)} if the auto commit
* setting is {@code false} when the connection is returned. It is true by default.
*
- * @param autoCommitOnReturn
- * Whether or not connections being returned to the pool will be checked and configured with auto-commit.
+ * @param autoCommitOnReturn Whether or not connections being returned to the pool will be checked and configured
+ * with auto-commit.
* @deprecated Use {@link #setAutoCommitOnReturn(boolean)}.
*/
@Deprecated
@@ -1982,8 +1946,7 @@
/**
* Sets the EvictionPolicy implementation to use with this connection pool.
*
- * @param evictionPolicyClassName
- * The fully qualified class name of the EvictionPolicy implementation
+ * @param evictionPolicyClassName The fully qualified class name of the EvictionPolicy implementation
*/
public synchronized void setEvictionPolicyClassName(final String evictionPolicyClassName) {
if (connectionPool != null) {
@@ -1994,8 +1957,7 @@
/**
* @see #getFastFailValidation()
- * @param fastFailValidation
- * true means connections created by this factory will fast fail validation
+ * @param fastFailValidation true means connections created by this factory will fast fail validation
* @since 2.1
*/
public void setFastFailValidation(final boolean fastFailValidation) {
@@ -2012,8 +1974,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param initialSize
- * the number of connections created when the pool is initialized
+ * @param initialSize the number of connections created when the pool is initialized
*/
public synchronized void setInitialSize(final int initialSize) {
this.initialSize = initialSize;
@@ -2025,8 +1986,7 @@
* this DataSource with JMX and this name is valid this name will be used in preference to any specified by the
* other component.
*
- * @param jmxName
- * The JMX name that has been requested for this DataSource
+ * @param jmxName The JMX name that has been requested for this DataSource
*/
public void setJmxName(final String jmxName) {
this.jmxName = jmxName;
@@ -2035,8 +1995,7 @@
/**
* Sets the LIFO property. True means the pool behaves as a LIFO queue; false means FIFO.
*
- * @param lifo
- * the new value for the LIFO property
+ * @param lifo the new value for the LIFO property
*/
public synchronized void setLifo(final boolean lifo) {
this.lifo = lifo;
@@ -2046,8 +2005,7 @@
}
/**
- * @param logAbandoned
- * new logAbandoned property value
+ * @param logAbandoned new logAbandoned property value
*/
public void setLogAbandoned(final boolean logAbandoned) {
if (abandonedConfig == null) {
@@ -2065,9 +2023,8 @@
* not log messages are generated when the pool closes connections due to maximum lifetime exceeded. Set this
* property to false to suppress log messages when connections expire.
*
- * @param logExpiredConnections
- * Whether or not log messages are generated when the pool closes connections due to maximum lifetime
- * exceeded.
+ * @param logExpiredConnections Whether or not log messages are generated when the pool closes connections due to
+ * maximum lifetime exceeded.
*/
public void setLogExpiredConnections(final boolean logExpiredConnections) {
this.logExpiredConnections = logExpiredConnections;
@@ -2083,16 +2040,15 @@
* Calls {@link #createDataSource()}, so has the side effect of initializing the connection pool.
*
*
- * @param loginTimeout
- * The new login timeout, or zero for no timeout
- * @throws UnsupportedOperationException
- * If the DataSource implementation does not support the login timeout feature.
- * @throws SQLException
- * if a database access error occurs
+ * @param loginTimeout The new login timeout, or zero for no timeout
+ * @throws UnsupportedOperationException If the DataSource implementation does not support the login timeout
+ * feature.
+ * @throws SQLException if a database access error occurs
*/
@Override
public void setLoginTimeout(final int loginTimeout) throws SQLException {
- // This method isn't supported by the PoolingDataSource returned by the createDataSource
+ // This method isn't supported by the PoolingDataSource returned by the
+ // createDataSource
throw new UnsupportedOperationException("Not supported by BasicDataSource");
}
@@ -2104,10 +2060,8 @@
* Calls {@link #createDataSource()}, so has the side effect of initializing the connection pool.
*
*
- * @param logWriter
- * The new log writer
- * @throws SQLException
- * if a database access error occurs
+ * @param logWriter The new log writer
+ * @throws SQLException if a database access error occurs
*/
@Override
public void setLogWriter(final PrintWriter logWriter) throws SQLException {
@@ -2126,8 +2080,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param maxConnLifetimeMillis
- * The maximum permitted lifetime of a connection in milliseconds.
+ * @param maxConnLifetimeMillis The maximum permitted lifetime of a connection in milliseconds.
*/
public void setMaxConnLifetimeMillis(final long maxConnLifetimeMillis) {
this.maxConnLifetimeMillis = maxConnLifetimeMillis;
@@ -2138,8 +2091,7 @@
* return to the pool.
*
* @see #getMaxIdle()
- * @param maxIdle
- * the new value for maxIdle
+ * @param maxIdle the new value for maxIdle
*/
public synchronized void setMaxIdle(final int maxIdle) {
this.maxIdle = maxIdle;
@@ -2158,8 +2110,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param maxOpenStatements
- * the new maximum number of prepared statements
+ * @param maxOpenStatements the new maximum number of prepared statements
*/
public synchronized void setMaxOpenPreparedStatements(final int maxOpenStatements) {
this.maxOpenPreparedStatements = maxOpenStatements;
@@ -2169,8 +2120,7 @@
* Sets the maximum total number of idle and borrows connections that can be active at the same time. Use a negative
* value for no limit.
*
- * @param maxTotal
- * the new value for maxTotal
+ * @param maxTotal the new value for maxTotal
* @see #getMaxTotal()
*/
public synchronized void setMaxTotal(final int maxTotal) {
@@ -2183,8 +2133,7 @@
/**
* Sets the MaxWaitMillis property. Use -1 to make the pool wait indefinitely.
*
- * @param maxWaitMillis
- * the new value for MaxWaitMillis
+ * @param maxWaitMillis the new value for MaxWaitMillis
* @see #getMaxWaitMillis()
*/
public synchronized void setMaxWaitMillis(final long maxWaitMillis) {
@@ -2197,8 +2146,7 @@
/**
* Sets the {@link #minEvictableIdleTimeMillis} property.
*
- * @param minEvictableIdleTimeMillis
- * the minimum amount of time an object may sit idle in the pool
+ * @param minEvictableIdleTimeMillis the minimum amount of time an object may sit idle in the pool
* @see #minEvictableIdleTimeMillis
*/
public synchronized void setMinEvictableIdleTimeMillis(final long minEvictableIdleTimeMillis) {
@@ -2208,13 +2156,14 @@
}
}
+ // ------------------------------------------------------ Protected Methods
+
/**
* Sets the minimum number of idle connections in the pool. The pool attempts to ensure that minIdle connections are
* available when the idle object evictor runs. The value of this property has no effect unless
* {@link #timeBetweenEvictionRunsMillis} has a positive value.
*
- * @param minIdle
- * the new value for minIdle
+ * @param minIdle the new value for minIdle
* @see GenericObjectPool#setMinIdle(int)
*/
public synchronized void setMinIdle(final int minIdle) {
@@ -2227,8 +2176,7 @@
/**
* Sets the value of the {@link #numTestsPerEvictionRun} property.
*
- * @param numTestsPerEvictionRun
- * the new {@link #numTestsPerEvictionRun} value
+ * @param numTestsPerEvictionRun the new {@link #numTestsPerEvictionRun} value
* @see #numTestsPerEvictionRun
*/
public synchronized void setNumTestsPerEvictionRun(final int numTestsPerEvictionRun) {
@@ -2238,8 +2186,6 @@
}
}
- // ------------------------------------------------------ Protected Methods
-
/**
*
*
- * @param password
- * new value for the password
+ * @param password new value for the password
*/
public void setPassword(final String password) {
this.password = password;
@@ -2267,16 +2212,15 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param poolingStatements
- * pooling on or off
+ * @param poolingStatements pooling on or off
*/
public synchronized void setPoolPreparedStatements(final boolean poolingStatements) {
this.poolPreparedStatements = poolingStatements;
}
/**
- * @param removeAbandonedOnBorrow
- * true means abandoned connections may be removed when connections are borrowed from the pool.
+ * @param removeAbandonedOnBorrow true means abandoned connections may be removed when connections are borrowed from
+ * the pool.
* @see #getRemoveAbandonedOnBorrow()
*/
public void setRemoveAbandonedOnBorrow(final boolean removeAbandonedOnBorrow) {
@@ -2291,8 +2235,7 @@
}
/**
- * @param removeAbandonedOnMaintenance
- * true means abandoned connections may be removed on pool maintenance.
+ * @param removeAbandonedOnMaintenance true means abandoned connections may be removed on pool maintenance.
* @see #getRemoveAbandonedOnMaintenance()
*/
public void setRemoveAbandonedOnMaintenance(final boolean removeAbandonedOnMaintenance) {
@@ -2316,8 +2259,7 @@
* {@link #getRemoveAbandonedOnMaintenance()} are false.
*
*
- * @param removeAbandonedTimeout
- * new abandoned timeout in seconds
+ * @param removeAbandonedTimeout new abandoned timeout in seconds
* @see #getRemoveAbandonedTimeout()
* @see #getRemoveAbandonedOnBorrow()
* @see #getRemoveAbandonedOnMaintenance()
@@ -2337,8 +2279,7 @@
* Sets the flag that controls if a connection will be rolled back when it is returned to the pool if auto commit is
* not enabled and the connection is not read only.
*
- * @param rollbackOnReturn
- * whether a connection will be rolled back when it is returned to the pool.
+ * @param rollbackOnReturn whether a connection will be rolled back when it is returned to the pool.
*/
public void setRollbackOnReturn(final boolean rollbackOnReturn) {
this.rollbackOnReturn = rollbackOnReturn;
@@ -2348,9 +2289,9 @@
* Sets the minimum amount of time a connection may sit idle in the pool before it is eligible for eviction by the
* idle object evictor, with the extra condition that at least "minIdle" connections remain in the pool.
*
- * @param softMinEvictableIdleTimeMillis
- * minimum amount of time a connection may sit idle in the pool before it is eligible for eviction,
- * assuming there are minIdle idle connections in the pool.
+ * @param softMinEvictableIdleTimeMillis minimum amount of time a connection may sit idle in the pool before it is
+ * eligible for eviction, assuming there are minIdle idle connections in the
+ * pool.
* @see #getSoftMinEvictableIdleTimeMillis
*/
public synchronized void setSoftMinEvictableIdleTimeMillis(final long softMinEvictableIdleTimeMillis) {
@@ -2364,8 +2305,7 @@
* Sets the {@link #testOnBorrow} property. This property determines whether or not the pool will validate objects
* before they are borrowed from the pool.
*
- * @param testOnBorrow
- * new value for testOnBorrow property
+ * @param testOnBorrow new value for testOnBorrow property
*/
public synchronized void setTestOnBorrow(final boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
@@ -2378,8 +2318,7 @@
* Sets the {@link #testOnCreate} property. This property determines whether or not the pool will validate objects
* immediately after they are created by the pool
*
- * @param testOnCreate
- * new value for testOnCreate property
+ * @param testOnCreate new value for testOnCreate property
*/
public synchronized void setTestOnCreate(final boolean testOnCreate) {
this.testOnCreate = testOnCreate;
@@ -2392,8 +2331,7 @@
* Sets the testOnReturn property. This property determines whether or not the pool will validate
* objects before they are returned to the pool.
*
- * @param testOnReturn
- * new value for testOnReturn property
+ * @param testOnReturn new value for testOnReturn property
*/
public synchronized void setTestOnReturn(final boolean testOnReturn) {
this.testOnReturn = testOnReturn;
@@ -2406,8 +2344,7 @@
* Sets the testWhileIdle property. This property determines whether or not the idle object evictor
* will validate connections.
*
- * @param testWhileIdle
- * new value for testWhileIdle property
+ * @param testWhileIdle new value for testWhileIdle property
*/
public synchronized void setTestWhileIdle(final boolean testWhileIdle) {
this.testWhileIdle = testWhileIdle;
@@ -2419,8 +2356,7 @@
/**
* Sets the {@link #timeBetweenEvictionRunsMillis} property.
*
- * @param timeBetweenEvictionRunsMillis
- * the new time between evictor runs
+ * @param timeBetweenEvictionRunsMillis the new time between evictor runs
* @see #timeBetweenEvictionRunsMillis
*/
public synchronized void setTimeBetweenEvictionRunsMillis(final long timeBetweenEvictionRunsMillis) {
@@ -2440,8 +2376,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param url
- * the new value for the JDBC connection url
+ * @param url the new value for the JDBC connection url
*/
public synchronized void setUrl(final String url) {
this.url = url;
@@ -2457,8 +2392,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param userName
- * the new value for the JDBC connection user name
+ * @param userName the new value for the JDBC connection user name
*/
public void setUsername(final String userName) {
this.userName = userName;
@@ -2474,14 +2408,13 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param validationQuery
- * the new value for the validation query
+ * @param validationQuery the new value for the validation query
*/
public void setValidationQuery(final String validationQuery) {
- if (validationQuery != null && validationQuery.trim().length() > 0) {
- this.validationQuery = validationQuery;
- } else {
+ if (isEmpty(validationQuery)) {
this.validationQuery = null;
+ } else {
+ this.validationQuery = validationQuery;
}
}
@@ -2494,8 +2427,7 @@
* setLoginTimeout, getLoginTimeout, getLogWriter.
*
*
- * @param validationQueryTimeoutSeconds
- * new validation query timeout value in seconds
+ * @param validationQueryTimeoutSeconds new validation query timeout value in seconds
*/
public void setValidationQueryTimeout(final int validationQueryTimeoutSeconds) {
this.validationQueryTimeoutSeconds = validationQueryTimeoutSeconds;
@@ -2524,4 +2456,5 @@
config.setJmxNameBase(base.toString());
config.setJmxNamePrefix(Constants.JMX_CONNECTION_POOL_PREFIX);
}
+
}
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java 1970-01-01 00:00:00.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java 2019-07-31 12:46:24.000000000 +0000
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.dbcp2;
+
+import java.sql.Driver;
+import java.sql.SQLException;
+import java.util.Properties;
+
+/*
+ * Creates {@link ConnectionFactory} instances.
+ *
+ * @since 2.7.0
+ */
+class ConnectionFactoryFactory {
+
+ /**
+ * Creates a new {@link DriverConnectionFactory} allowing for an override through
+ * {@link BasicDataSource#getDriverClassName()}.
+ *
+ * @param basicDataSource Configures creation.
+ * @param driver The JDBC driver.
+ * @return a new {@link DriverConnectionFactory} allowing for a {@link BasicDataSource#getDriverClassName()}
+ * override.
+ * @throws SQLException Thrown when instantiation fails.
+ */
+ static ConnectionFactory createConnectionFactory(final BasicDataSource basicDataSource, final Driver driver)
+ throws SQLException {
+ final Properties connectionProperties = basicDataSource.getConnectionProperties();
+ final String url = basicDataSource.getUrl();
+ // Set up the driver connection factory we will use
+ final String user = basicDataSource.getUsername();
+ if (user != null) {
+ connectionProperties.put("user", user);
+ } else {
+ basicDataSource.log("DBCP DataSource configured without a 'username'");
+ }
+
+ final String pwd = basicDataSource.getPassword();
+ if (pwd != null) {
+ connectionProperties.put("password", pwd);
+ } else {
+ basicDataSource.log("DBCP DataSource configured without a 'password'");
+ }
+ final String connectionFactoryClassName = basicDataSource.getConnectionFactoryClassName();
+ if (connectionFactoryClassName != null) {
+ try {
+ final Class> connectionFactoryFromCCL = Class.forName(connectionFactoryClassName);
+ return (ConnectionFactory) connectionFactoryFromCCL
+ .getConstructor(Driver.class, String.class, Properties.class)
+ .newInstance(driver, url, connectionProperties);
+ } catch (final Exception t) {
+ final String message = "Cannot load ConnectionFactory implementation '" + connectionFactoryClassName
+ + "'";
+ basicDataSource.log(message, t);
+ throw new SQLException(message, t);
+ }
+ }
+ // Defaults to DriverConnectionFactory
+ return new DriverConnectionFactory(driver, url, connectionProperties);
+ }
+
+}
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java 2019-07-31 12:46:24.000000000 +0000
@@ -86,6 +86,11 @@
private static final String GET_CONNECTION_CALLED = "A PooledConnection was already requested from this source, "
+ "further initialization is not allowed.";
+ static {
+ // Attempt to prevent deadlocks - see DBCP - 272
+ DriverManager.getDrivers();
+ }
+
/** Description */
private String description;
@@ -106,13 +111,13 @@
/** Log stream. NOT USED */
private transient PrintWriter logWriter;
-
// PreparedStatement pool properties
private boolean poolPreparedStatements;
private int maxIdle = 10;
private long timeBetweenEvictionRunsMillis = BaseObjectPoolConfig.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS;
private int numTestsPerEvictionRun = -1;
private int minEvictableIdleTimeMillis = -1;
+
private int maxPreparedStatements = -1;
/** Whether or not getConnection has been called */
@@ -121,11 +126,6 @@
/** Connection properties passed to JDBC Driver */
private Properties connectionProperties;
- static {
- // Attempt to prevent deadlocks - see DBCP - 272
- DriverManager.getDrivers();
- }
-
/**
* Controls access to the underlying connection
*/
@@ -138,6 +138,208 @@
}
/**
+ * Throws an IllegalStateException, if a PooledConnection has already been requested.
+ */
+ private void assertInitializationAllowed() throws IllegalStateException {
+ if (getConnectionCalled) {
+ throw new IllegalStateException(GET_CONNECTION_CALLED);
+ }
+ }
+
+ private boolean getBooleanContentString(RefAddr ra) {
+ return Boolean.valueOf(getStringContent(ra)).booleanValue();
+ }
+
+ /**
+ * Gets the connection properties passed to the JDBC driver.
+ *
+ * @return the JDBC connection properties used when creating connections.
+ */
+ public Properties getConnectionProperties() {
+ return connectionProperties;
+ }
+
+ /**
+ * Gets the value of description. This property is here for use by the code which will deploy this datasource. It is
+ * not used internally.
+ *
+ * @return value of description, may be null.
+ * @see #setDescription(String)
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the driver class name.
+ *
+ * @return value of driver.
+ */
+ public String getDriver() {
+ return driver;
+ }
+
+ private int getIntegerStringContent(final RefAddr ra) {
+ return Integer.parseInt(getStringContent(ra));
+ }
+
+ /**
+ * Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. NOT
+ * USED.
+ */
+ @Override
+ public int getLoginTimeout() {
+ return loginTimeout;
+ }
+
+ /**
+ * Gets the log writer for this data source. NOT USED.
+ */
+ @Override
+ public PrintWriter getLogWriter() {
+ return logWriter;
+ }
+
+ /**
+ * Gets the maximum number of statements that can remain idle in the pool, without extra ones being released, or
+ * negative for no limit.
+ *
+ * @return the value of maxIdle
+ */
+ public int getMaxIdle() {
+ return this.maxIdle;
+ }
+
+ /**
+ * Gets the maximum number of prepared statements.
+ *
+ * @return maxPrepartedStatements value
+ */
+ public int getMaxPreparedStatements() {
+ return maxPreparedStatements;
+ }
+
+ /**
+ * Gets the minimum amount of time a statement may sit idle in the pool before it is eligible for eviction by the
+ * idle object evictor (if any).
+ *
+ * @see #setMinEvictableIdleTimeMillis
+ * @see #setTimeBetweenEvictionRunsMillis
+ * @return the minimum amount of time a statement may sit idle in the pool.
+ */
+ public int getMinEvictableIdleTimeMillis() {
+ return minEvictableIdleTimeMillis;
+ }
+
+ /**
+ * Gets the number of statements to examine during each run of the idle object evictor thread (if any.)
+ *
+ * @see #setNumTestsPerEvictionRun
+ * @see #setTimeBetweenEvictionRunsMillis
+ * @return the number of statements to examine during each run of the idle object evictor thread (if any.)
+ */
+ public int getNumTestsPerEvictionRun() {
+ return numTestsPerEvictionRun;
+ }
+
+ /**
+ * Implements {@link ObjectFactory} to create an instance of this class
+ */
+ @Override
+ public Object getObjectInstance(final Object refObj, final Name name, final Context context,
+ final Hashtable, ?> env) throws Exception {
+ // The spec says to return null if we can't create an instance
+ // of the reference
+ DriverAdapterCPDS cpds = null;
+ if (refObj instanceof Reference) {
+ final Reference ref = (Reference) refObj;
+ if (ref.getClassName().equals(getClass().getName())) {
+ RefAddr ra = ref.get("description");
+ if (isNotEmpty(ra)) {
+ setDescription(getStringContent(ra));
+ }
+
+ ra = ref.get("driver");
+ if (isNotEmpty(ra)) {
+ setDriver(getStringContent(ra));
+ }
+ ra = ref.get("url");
+ if (isNotEmpty(ra)) {
+ setUrl(getStringContent(ra));
+ }
+ ra = ref.get(KEY_USER);
+ if (isNotEmpty(ra)) {
+ setUser(getStringContent(ra));
+ }
+ ra = ref.get(KEY_PASSWORD);
+ if (isNotEmpty(ra)) {
+ setPassword(getStringContent(ra));
+ }
+
+ ra = ref.get("poolPreparedStatements");
+ if (isNotEmpty(ra)) {
+ setPoolPreparedStatements(getBooleanContentString(ra));
+ }
+ ra = ref.get("maxIdle");
+ if (isNotEmpty(ra)) {
+ setMaxIdle(getIntegerStringContent(ra));
+ }
+
+ ra = ref.get("timeBetweenEvictionRunsMillis");
+ if (isNotEmpty(ra)) {
+ setTimeBetweenEvictionRunsMillis(getIntegerStringContent(ra));
+ }
+
+ ra = ref.get("numTestsPerEvictionRun");
+ if (isNotEmpty(ra)) {
+ setNumTestsPerEvictionRun(getIntegerStringContent(ra));
+ }
+
+ ra = ref.get("minEvictableIdleTimeMillis");
+ if (isNotEmpty(ra)) {
+ setMinEvictableIdleTimeMillis(getIntegerStringContent(ra));
+ }
+ ra = ref.get("maxPreparedStatements");
+ if (isNotEmpty(ra)) {
+ setMaxPreparedStatements(getIntegerStringContent(ra));
+ }
+
+ ra = ref.get("accessToUnderlyingConnectionAllowed");
+ if (isNotEmpty(ra)) {
+ setAccessToUnderlyingConnectionAllowed(getBooleanContentString(ra));
+ }
+
+ cpds = this;
+ }
+ }
+ return cpds;
+ }
+
+ @Override
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ throw new SQLFeatureNotSupportedException();
+ }
+
+ /**
+ * Gets the value of password for the default user.
+ *
+ * @return value of password.
+ */
+ public String getPassword() {
+ return Utils.toString(userPassword);
+ }
+
+ /**
+ * Gets the value of password for the default user.
+ *
+ * @return value of password.
+ * @since 2.4.0
+ */
+ public char[] getPasswordCharArray() {
+ return userPassword;
+ }
+
+ /**
* Attempts to establish a database connection using the default user and password.
*/
@Override
@@ -146,7 +348,7 @@
}
/**
- * Attempt to establish a database connection.
+ * Attempts to establish a database connection.
*
* @param pooledUserName
* name to be used for the connection
@@ -208,16 +410,8 @@
return pooledConnection;
}
- @Override
- public Logger getParentLogger() throws SQLFeatureNotSupportedException {
- throw new SQLFeatureNotSupportedException();
- }
-
- // ----------------------------------------------------------------------
- // Referenceable implementation
-
/**
- * Referenceable implementation.
+ * Implements {@link Referenceable}.
*/
@Override
public Reference getReference() throws NamingException {
@@ -243,256 +437,110 @@
return ref;
}
- // ----------------------------------------------------------------------
- // ObjectFactory implementation
-
- /**
- * implements ObjectFactory to create an instance of this class
- */
- @Override
- public Object getObjectInstance(final Object refObj, final Name name, final Context context,
- final Hashtable, ?> env) throws Exception {
- // The spec says to return null if we can't create an instance
- // of the reference
- DriverAdapterCPDS cpds = null;
- if (refObj instanceof Reference) {
- final Reference ref = (Reference) refObj;
- if (ref.getClassName().equals(getClass().getName())) {
- RefAddr ra = ref.get("description");
- if (ra != null && ra.getContent() != null) {
- setDescription(ra.getContent().toString());
- }
-
- ra = ref.get("driver");
- if (ra != null && ra.getContent() != null) {
- setDriver(ra.getContent().toString());
- }
- ra = ref.get("url");
- if (ra != null && ra.getContent() != null) {
- setUrl(ra.getContent().toString());
- }
- ra = ref.get(KEY_USER);
- if (ra != null && ra.getContent() != null) {
- setUser(ra.getContent().toString());
- }
- ra = ref.get(KEY_PASSWORD);
- if (ra != null && ra.getContent() != null) {
- setPassword(ra.getContent().toString());
- }
-
- ra = ref.get("poolPreparedStatements");
- if (ra != null && ra.getContent() != null) {
- setPoolPreparedStatements(Boolean.valueOf(ra.getContent().toString()).booleanValue());
- }
- ra = ref.get("maxIdle");
- if (ra != null && ra.getContent() != null) {
- setMaxIdle(Integer.parseInt(ra.getContent().toString()));
- }
-
- ra = ref.get("timeBetweenEvictionRunsMillis");
- if (ra != null && ra.getContent() != null) {
- setTimeBetweenEvictionRunsMillis(Integer.parseInt(ra.getContent().toString()));
- }
-
- ra = ref.get("numTestsPerEvictionRun");
- if (ra != null && ra.getContent() != null) {
- setNumTestsPerEvictionRun(Integer.parseInt(ra.getContent().toString()));
- }
-
- ra = ref.get("minEvictableIdleTimeMillis");
- if (ra != null && ra.getContent() != null) {
- setMinEvictableIdleTimeMillis(Integer.parseInt(ra.getContent().toString()));
- }
- ra = ref.get("maxPreparedStatements");
- if (ra != null && ra.getContent() != null) {
- setMaxPreparedStatements(Integer.parseInt(ra.getContent().toString()));
- }
-
- ra = ref.get("accessToUnderlyingConnectionAllowed");
- if (ra != null && ra.getContent() != null) {
- setAccessToUnderlyingConnectionAllowed(Boolean.valueOf(ra.getContent().toString()).booleanValue());
- }
-
- cpds = this;
- }
- }
- return cpds;
- }
-
- /**
- * Throws an IllegalStateException, if a PooledConnection has already been requested.
- */
- private void assertInitializationAllowed() throws IllegalStateException {
- if (getConnectionCalled) {
- throw new IllegalStateException(GET_CONNECTION_CALLED);
- }
+ private String getStringContent(RefAddr ra) {
+ return ra.getContent().toString();
}
- // ----------------------------------------------------------------------
- // Properties
-
/**
- * Gets the connection properties passed to the JDBC driver.
- *
- * @return the JDBC connection properties used when creating connections.
- */
- public Properties getConnectionProperties() {
- return connectionProperties;
- }
-
- /**
- *
- * Sets the connection properties passed to the JDBC driver.
- *
- *
- *
- * If props contains "user" and/or "password" properties, the corresponding instance properties are
- * set. If these properties are not present, they are filled in using {@link #getUser()}, {@link #getPassword()}
- * when {@link #getPooledConnection()} is called, or using the actual parameters to the method call when
- * {@link #getPooledConnection(String, String)} is called. Calls to {@link #setUser(String)} or
- * {@link #setPassword(String)} overwrite the values of these properties if connectionProperties is not
- * null.
- *
- *
- * @param props
- * Connection properties to use when creating new connections.
- * @throws IllegalStateException
- * if {@link #getPooledConnection()} has been called
- */
- public void setConnectionProperties(final Properties props) {
- assertInitializationAllowed();
- connectionProperties = props;
- if (connectionProperties != null) {
- if (connectionProperties.containsKey(KEY_USER)) {
- setUser(connectionProperties.getProperty(KEY_USER));
- }
- if (connectionProperties.containsKey(KEY_PASSWORD)) {
- setPassword(connectionProperties.getProperty(KEY_PASSWORD));
- }
- }
- }
-
- /**
- * Gets the value of description. This property is here for use by the code which will deploy this datasource. It is
- * not used internally.
- *
- * @return value of description, may be null.
- * @see #setDescription(String)
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the value of description. This property is here for use by the code which will deploy this datasource. It is
- * not used internally.
- *
- * @param v
- * Value to assign to description.
- */
- public void setDescription(final String v) {
- this.description = v;
- }
-
- /**
- * Gets the value of password for the default user.
- *
- * @return value of password.
- * @since 2.4.0
- */
- public char[] getPasswordCharArray() {
- return userPassword;
- }
-
- /**
- * Gets the value of password for the default user.
+ * Gets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no
+ * idle object evictor thread will be run.
*
- * @return value of password.
+ * @return the value of the evictor thread timer
+ * @see #setTimeBetweenEvictionRunsMillis(long)
*/
- public String getPassword() {
- return Utils.toString(userPassword);
+ public long getTimeBetweenEvictionRunsMillis() {
+ return timeBetweenEvictionRunsMillis;
}
/**
- * Sets the value of password for the default user.
+ * Gets the value of url used to locate the database for this datasource.
*
- * @param userPassword
- * Value to assign to password.
- * @throws IllegalStateException
- * if {@link #getPooledConnection()} has been called
+ * @return value of url.
*/
- public void setPassword(final char[] userPassword) {
- assertInitializationAllowed();
- this.userPassword = Utils.clone(userPassword);
- update(connectionProperties, KEY_PASSWORD, Utils.toString(this.userPassword));
+ public String getUrl() {
+ return url;
}
/**
- * Sets the value of password for the default user.
+ * Gets the value of default user (login or user name).
*
- * @param userPassword
- * Value to assign to password.
- * @throws IllegalStateException
- * if {@link #getPooledConnection()} has been called
+ * @return value of user.
*/
- public void setPassword(final String userPassword) {
- assertInitializationAllowed();
- this.userPassword = Utils.toCharArray(userPassword);
- update(connectionProperties, KEY_PASSWORD, userPassword);
+ public String getUser() {
+ return userName;
}
/**
- * Gets the value of url used to locate the database for this datasource.
+ * Returns the value of the accessToUnderlyingConnectionAllowed property.
*
- * @return value of url.
+ * @return true if access to the underlying is allowed, false otherwise.
*/
- public String getUrl() {
- return url;
+ public synchronized boolean isAccessToUnderlyingConnectionAllowed() {
+ return this.accessToUnderlyingConnectionAllowed;
+ }
+
+ private boolean isNotEmpty(RefAddr ra) {
+ return ra != null && ra.getContent() != null;
}
/**
- * Sets the value of URL string used to locate the database for this datasource.
+ * Whether to toggle the pooling of PreparedStatements
*
- * @param v
- * Value to assign to url.
- * @throws IllegalStateException
- * if {@link #getPooledConnection()} has been called
+ * @return value of poolPreparedStatements.
*/
- public void setUrl(final String v) {
- assertInitializationAllowed();
- this.url = v;
+ public boolean isPoolPreparedStatements() {
+ return poolPreparedStatements;
}
/**
- * Gets the value of default user (login or user name).
+ * Sets the value of the accessToUnderlyingConnectionAllowed property. It controls if the PoolGuard allows access to
+ * the underlying connection. (Default: false)
*
- * @return value of user.
+ * @param allow
+ * Access to the underlying connection is granted when true.
*/
- public String getUser() {
- return userName;
+ public synchronized void setAccessToUnderlyingConnectionAllowed(final boolean allow) {
+ this.accessToUnderlyingConnectionAllowed = allow;
}
/**
- * Sets the value of default user (login or user name).
+ * Sets the connection properties passed to the JDBC driver.
+ *
+ * If props contains "user" and/or "password" properties, the corresponding instance properties are
+ * set. If these properties are not present, they are filled in using {@link #getUser()}, {@link #getPassword()}
+ * when {@link #getPooledConnection()} is called, or using the actual parameters to the method call when
+ * {@link #getPooledConnection(String, String)} is called. Calls to {@link #setUser(String)} or
+ * {@link #setPassword(String)} overwrite the values of these properties if connectionProperties is not
+ * null.
+ *
*
- * @param v
- * Value to assign to user.
+ * @param props
+ * Connection properties to use when creating new connections.
* @throws IllegalStateException
* if {@link #getPooledConnection()} has been called
*/
- public void setUser(final String v) {
+ public void setConnectionProperties(final Properties props) {
assertInitializationAllowed();
- this.userName = v;
- update(connectionProperties, KEY_USER, v);
+ connectionProperties = props;
+ if (connectionProperties != null) {
+ if (connectionProperties.containsKey(KEY_USER)) {
+ setUser(connectionProperties.getProperty(KEY_USER));
+ }
+ if (connectionProperties.containsKey(KEY_PASSWORD)) {
+ setPassword(connectionProperties.getProperty(KEY_PASSWORD));
+ }
+ }
}
/**
- * Gets the driver class name.
+ * Sets the value of description. This property is here for use by the code which will deploy this datasource. It is
+ * not used internally.
*
- * @return value of driver.
+ * @param v
+ * Value to assign to description.
*/
- public String getDriver() {
- return driver;
+ public void setDescription(final String v) {
+ this.description = v;
}
/**
@@ -514,23 +562,6 @@
}
/**
- * Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. NOT
- * USED.
- */
- @Override
- public int getLoginTimeout() {
- return loginTimeout;
- }
-
- /**
- * Gets the log writer for this data source. NOT USED.
- */
- @Override
- public PrintWriter getLogWriter() {
- return logWriter;
- }
-
- /**
* Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. NOT
* USED.
*/
@@ -547,41 +578,6 @@
logWriter = out;
}
- // ------------------------------------------------------------------
- // PreparedStatement pool properties
-
- /**
- * Flag to toggle the pooling of PreparedStatements
- *
- * @return value of poolPreparedStatements.
- */
- public boolean isPoolPreparedStatements() {
- return poolPreparedStatements;
- }
-
- /**
- * Flag to toggle the pooling of PreparedStatements
- *
- * @param poolPreparedStatements
- * true to pool statements.
- * @throws IllegalStateException
- * if {@link #getPooledConnection()} has been called
- */
- public void setPoolPreparedStatements(final boolean poolPreparedStatements) {
- assertInitializationAllowed();
- this.poolPreparedStatements = poolPreparedStatements;
- }
-
- /**
- * Gets the maximum number of statements that can remain idle in the pool, without extra ones being released, or
- * negative for no limit.
- *
- * @return the value of maxIdle
- */
- public int getMaxIdle() {
- return this.maxIdle;
- }
-
/**
* Gets the maximum number of statements that can remain idle in the pool, without extra ones being released, or
* negative for no limit.
@@ -597,41 +593,29 @@
}
/**
- * Gets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no
- * idle object evictor thread will be run.
+ * Sets the maximum number of prepared statements.
*
- * @return the value of the evictor thread timer
- * @see #setTimeBetweenEvictionRunsMillis(long)
+ * @param maxPreparedStatements
+ * the new maximum number of prepared statements
*/
- public long getTimeBetweenEvictionRunsMillis() {
- return timeBetweenEvictionRunsMillis;
+ public void setMaxPreparedStatements(final int maxPreparedStatements) {
+ this.maxPreparedStatements = maxPreparedStatements;
}
/**
- * Sets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no
- * idle object evictor thread will be run.
+ * Sets the minimum amount of time a statement may sit idle in the pool before it is eligible for eviction by the
+ * idle object evictor (if any). When non-positive, no objects will be evicted from the pool due to idle time alone.
*
- * @param timeBetweenEvictionRunsMillis
- * The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive,
- * no idle object evictor thread will be run.
- * @see #getTimeBetweenEvictionRunsMillis()
+ * @param minEvictableIdleTimeMillis
+ * minimum time to set (in ms)
+ * @see #getMinEvictableIdleTimeMillis()
+ * @see #setTimeBetweenEvictionRunsMillis(long)
* @throws IllegalStateException
* if {@link #getPooledConnection()} has been called
*/
- public void setTimeBetweenEvictionRunsMillis(final long timeBetweenEvictionRunsMillis) {
+ public void setMinEvictableIdleTimeMillis(final int minEvictableIdleTimeMillis) {
assertInitializationAllowed();
- this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
- }
-
- /**
- * Gets the number of statements to examine during each run of the idle object evictor thread (if any.)
- *
- * @see #setNumTestsPerEvictionRun
- * @see #setTimeBetweenEvictionRunsMillis
- * @return the number of statements to examine during each run of the idle object evictor thread (if any.)
- */
- public int getNumTestsPerEvictionRun() {
- return numTestsPerEvictionRun;
+ this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
}
/**
@@ -655,80 +639,87 @@
}
/**
- * Gets the minimum amount of time a statement may sit idle in the pool before it is eligible for eviction by the
- * idle object evictor (if any).
+ * Sets the value of password for the default user.
*
- * @see #setMinEvictableIdleTimeMillis
- * @see #setTimeBetweenEvictionRunsMillis
- * @return the minimum amount of time a statement may sit idle in the pool.
+ * @param userPassword
+ * Value to assign to password.
+ * @throws IllegalStateException
+ * if {@link #getPooledConnection()} has been called
*/
- public int getMinEvictableIdleTimeMillis() {
- return minEvictableIdleTimeMillis;
+ public void setPassword(final char[] userPassword) {
+ assertInitializationAllowed();
+ this.userPassword = Utils.clone(userPassword);
+ update(connectionProperties, KEY_PASSWORD, Utils.toString(this.userPassword));
}
/**
- * Sets the minimum amount of time a statement may sit idle in the pool before it is eligible for eviction by the
- * idle object evictor (if any). When non-positive, no objects will be evicted from the pool due to idle time alone.
+ * Sets the value of password for the default user.
*
- * @param minEvictableIdleTimeMillis
- * minimum time to set (in ms)
- * @see #getMinEvictableIdleTimeMillis()
- * @see #setTimeBetweenEvictionRunsMillis(long)
+ * @param userPassword
+ * Value to assign to password.
* @throws IllegalStateException
* if {@link #getPooledConnection()} has been called
*/
- public void setMinEvictableIdleTimeMillis(final int minEvictableIdleTimeMillis) {
+ public void setPassword(final String userPassword) {
assertInitializationAllowed();
- this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
+ this.userPassword = Utils.toCharArray(userPassword);
+ update(connectionProperties, KEY_PASSWORD, userPassword);
}
/**
- * Returns the value of the accessToUnderlyingConnectionAllowed property.
+ * Whether to toggle the pooling of PreparedStatements
*
- * @return true if access to the underlying is allowed, false otherwise.
+ * @param poolPreparedStatements
+ * true to pool statements.
+ * @throws IllegalStateException
+ * if {@link #getPooledConnection()} has been called
*/
- public synchronized boolean isAccessToUnderlyingConnectionAllowed() {
- return this.accessToUnderlyingConnectionAllowed;
+ public void setPoolPreparedStatements(final boolean poolPreparedStatements) {
+ assertInitializationAllowed();
+ this.poolPreparedStatements = poolPreparedStatements;
}
/**
- * Sets the value of the accessToUnderlyingConnectionAllowed property. It controls if the PoolGuard allows access to
- * the underlying connection. (Default: false)
+ * Sets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no
+ * idle object evictor thread will be run.
*
- * @param allow
- * Access to the underlying connection is granted when true.
+ * @param timeBetweenEvictionRunsMillis
+ * The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive,
+ * no idle object evictor thread will be run.
+ * @see #getTimeBetweenEvictionRunsMillis()
+ * @throws IllegalStateException
+ * if {@link #getPooledConnection()} has been called
*/
- public synchronized void setAccessToUnderlyingConnectionAllowed(final boolean allow) {
- this.accessToUnderlyingConnectionAllowed = allow;
+ public void setTimeBetweenEvictionRunsMillis(final long timeBetweenEvictionRunsMillis) {
+ assertInitializationAllowed();
+ this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
}
/**
- * Gets the maximum number of prepared statements.
+ * Sets the value of URL string used to locate the database for this datasource.
*
- * @return maxPrepartedStatements value
+ * @param v
+ * Value to assign to url.
+ * @throws IllegalStateException
+ * if {@link #getPooledConnection()} has been called
*/
- public int getMaxPreparedStatements() {
- return maxPreparedStatements;
+ public void setUrl(final String v) {
+ assertInitializationAllowed();
+ this.url = v;
}
/**
- * Sets the maximum number of prepared statements.
+ * Sets the value of default user (login or user name).
*
- * @param maxPreparedStatements
- * the new maximum number of prepared statements
+ * @param v
+ * Value to assign to user.
+ * @throws IllegalStateException
+ * if {@link #getPooledConnection()} has been called
*/
- public void setMaxPreparedStatements(final int maxPreparedStatements) {
- this.maxPreparedStatements = maxPreparedStatements;
- }
-
- private void update(final Properties properties, final String key, final String value) {
- if (properties != null) {
- if (value == null) {
- properties.remove(key);
- } else {
- properties.setProperty(key, value);
- }
- }
+ public void setUser(final String v) {
+ assertInitializationAllowed();
+ this.userName = v;
+ update(connectionProperties, KEY_USER, v);
}
/**
@@ -765,7 +756,7 @@
builder.append(", connectionProperties=");
Properties tmpProps = connectionProperties;
final String pwdKey = "password";
- if (connectionProperties.contains(pwdKey)) {
+ if (connectionProperties != null && connectionProperties.contains(pwdKey)) {
tmpProps = (Properties) connectionProperties.clone();
tmpProps.remove(pwdKey);
}
@@ -775,4 +766,14 @@
builder.append("]");
return builder.toString();
}
+
+ private void update(final Properties properties, final String key, final String value) {
+ if (properties != null && key != null) {
+ if (value == null) {
+ properties.remove(key);
+ } else {
+ properties.setProperty(key, value);
+ }
+ }
+ }
}
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java 2019-07-31 12:46:24.000000000 +0000
@@ -181,6 +181,10 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
+ *
+ * @param sql
+ * The SQL statement.
+ * @return a {@link PStmtKey} for the given arguments.
*/
protected PStmtKey createKey(final String sql) {
return new PStmtKey(normalizeSQL(sql), getCatalogOrNull(), getSchemaOrNull());
@@ -188,6 +192,13 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
+ *
+ * @param sql
+ * The SQL statement.
+ * @param autoGeneratedKeys
+ * A flag indicating whether auto-generated keys should be returned; one of
+ * Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS.
+ * @return a key to uniquely identify a prepared statement.
*/
protected PStmtKey createKey(final String sql, final int autoGeneratedKeys) {
return new PStmtKey(normalizeSQL(sql), getCatalogOrNull(), getSchemaOrNull(), autoGeneratedKeys);
@@ -195,6 +206,13 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
+ *
+ * @param sql
+ * The SQL statement.
+ * @param columnIndexes
+ * An array of column indexes indicating the columns that should be returned from the inserted row or
+ * rows.
+ * @return a key to uniquely identify a prepared statement.
*/
protected PStmtKey createKey(final String sql, final int columnIndexes[]) {
return new PStmtKey(normalizeSQL(sql), getCatalogOrNull(), getSchemaOrNull(), columnIndexes);
@@ -202,6 +220,16 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
+ *
+ * @param sql
+ * The SQL statement.
+ * @param resultSetType
+ * A result set type; one of ResultSet.TYPE_FORWARD_ONLY,
+ * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE.
+ * @param resultSetConcurrency
+ * A concurrency type; one of ResultSet.CONCUR_READ_ONLY or
+ * ResultSet.CONCUR_UPDATABLE.
+ * @return a key to uniquely identify a prepared statement.
*/
protected PStmtKey createKey(final String sql, final int resultSetType, final int resultSetConcurrency) {
return new PStmtKey(normalizeSQL(sql), getCatalogOrNull(), getSchemaOrNull(), resultSetType,
@@ -210,6 +238,19 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
+ *
+ * @param sql
+ * The SQL statement.
+ * @param resultSetType
+ * a result set type; one of ResultSet.TYPE_FORWARD_ONLY,
+ * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE.
+ * @param resultSetConcurrency
+ * A concurrency type; one of ResultSet.CONCUR_READ_ONLY or
+ * ResultSet.CONCUR_UPDATABLE
+ * @param resultSetHoldability
+ * One of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT
+ * or ResultSet.CLOSE_CURSORS_AT_COMMIT.
+ * @return a key to uniquely identify a prepared statement.
*/
protected PStmtKey createKey(final String sql, final int resultSetType, final int resultSetConcurrency,
final int resultSetHoldability) {
@@ -220,6 +261,20 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
*
+ * @param sql
+ * The SQL statement.
+ * @param resultSetType
+ * a result set type; one of ResultSet.TYPE_FORWARD_ONLY,
+ * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
+ * @param resultSetConcurrency
+ * A concurrency type; one of ResultSet.CONCUR_READ_ONLY or
+ * ResultSet.CONCUR_UPDATABLE.
+ * @param resultSetHoldability
+ * One of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT
+ * or ResultSet.CLOSE_CURSORS_AT_COMMIT.
+ * @param statementType
+ * The SQL statement type, prepared or callable.
+ * @return a key to uniquely identify a prepared statement.
* @since 2.4.0
*/
protected PStmtKey createKey(final String sql, final int resultSetType, final int resultSetConcurrency,
@@ -231,6 +286,17 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
*
+ * @param sql
+ * The SQL statement.
+ * @param resultSetType
+ * A result set type; one of ResultSet.TYPE_FORWARD_ONLY,
+ * ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE.
+ * @param resultSetConcurrency
+ * A concurrency type; one of ResultSet.CONCUR_READ_ONLY or
+ * ResultSet.CONCUR_UPDATABLE.
+ * @param statementType
+ * The SQL statement type, prepared or callable.
+ * @return a key to uniquely identify a prepared statement.
* @since 2.4.0
*/
protected PStmtKey createKey(final String sql, final int resultSetType, final int resultSetConcurrency,
@@ -241,6 +307,12 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
+ *
+ * @param sql
+ * The SQL statement.
+ * @param statementType
+ * The SQL statement type, prepared or callable.
+ * @return a key to uniquely identify a prepared statement.
*/
protected PStmtKey createKey(final String sql, final StatementType statementType) {
return new PStmtKey(normalizeSQL(sql), getCatalogOrNull(), getSchemaOrNull(), statementType);
@@ -248,6 +320,12 @@
/**
* Creates a {@link PStmtKey} for the given arguments.
+ *
+ * @param sql
+ * The SQL statement.
+ * @param columnNames
+ * An array of column names indicating the columns that should be returned from the inserted row or rows.
+ * @return a key to uniquely identify a prepared statement.
*/
protected PStmtKey createKey(final String sql, final String columnNames[]) {
return new PStmtKey(normalizeSQL(sql), getCatalogOrNull(), getSchemaOrNull(), columnNames);
@@ -361,6 +439,9 @@
/**
* Normalizes the given SQL statement, producing a canonical form that is semantically equivalent to the original.
+ * @param sql
+ * The SQL statement.
+ * @return the normalized SQL statement.
*/
protected String normalizeSQL(final String sql) {
return sql.trim();
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSourceFactory.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSourceFactory.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSourceFactory.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSourceFactory.java 2019-07-31 12:46:24.000000000 +0000
@@ -120,7 +120,7 @@
if (isCorrectClass(ref.getClassName())) {
final RefAddr refAddr = ref.get("instanceKey");
if (refAddr != null && refAddr.getContent() != null) {
- // object was bound to jndi via Referenceable api.
+ // object was bound to JNDI via Referenceable API.
obj = instanceMap.get(refAddr.getContent());
} else {
// Tomcat JNDI creates a Reference out of server.xml
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java 2019-07-31 12:46:24.000000000 +0000
@@ -98,7 +98,7 @@
/** Description */
private String description;
- /** Environment that may be used to set up a jndi initial context. */
+ /** Environment that may be used to set up a JNDI initial context. */
private Properties jndiEnvironment;
/** Login TimeOut in seconds */
@@ -146,6 +146,8 @@
/**
* Throws an IllegalStateException, if a PooledConnection has already been requested.
+ *
+ * @throws IllegalStateException Thrown if a PooledConnection has already been requested.
*/
protected void assertInitializationAllowed() throws IllegalStateException {
if (getConnectionCalled) {
@@ -520,8 +522,8 @@
}
/**
- * Gets the value of connectionPoolDataSource. This method will return null, if the backing datasource is being
- * accessed via jndi.
+ * Gets the value of connectionPoolDataSource. This method will return null, if the backing data source is being
+ * accessed via JNDI.
*
* @return value of connectionPoolDataSource.
*/
@@ -530,8 +532,8 @@
}
/**
- * Sets the backend ConnectionPoolDataSource. This property should not be set if using jndi to access the
- * datasource.
+ * Sets the backend ConnectionPoolDataSource. This property should not be set if using JNDI to access the
+ * data source.
*
* @param v
* Value to assign to connectionPoolDataSource.
@@ -549,8 +551,8 @@
}
/**
- * Gets the name of the ConnectionPoolDataSource which backs this pool. This name is used to look up the datasource
- * from a jndi service provider.
+ * Gets the name of the ConnectionPoolDataSource which backs this pool. This name is used to look up the data source
+ * from a JNDI service provider.
*
* @return value of dataSourceName.
*/
@@ -559,8 +561,8 @@
}
/**
- * Sets the name of the ConnectionPoolDataSource which backs this pool. This name is used to look up the datasource
- * from a jndi service provider.
+ * Sets the name of the ConnectionPoolDataSource which backs this pool. This name is used to look up the data source
+ * from a JNDI service provider.
*
* @param v
* Value to assign to dataSourceName.
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java 2019-07-31 12:46:24.000000000 +0000
@@ -34,6 +34,7 @@
import java.sql.Savepoint;
import java.sql.Statement;
import java.sql.Struct;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -87,19 +88,20 @@
/**
* Returns a string representation of the metadata associated with the innermost delegate connection.
*/
+ @SuppressWarnings("resource")
@Override
public synchronized String toString() {
- String s = null;
+ String str = null;
- final Connection c = this.getInnermostDelegateInternal();
- if (c != null) {
+ final Connection conn = this.getInnermostDelegateInternal();
+ if (conn != null) {
try {
- if (c.isClosed()) {
- s = "connection is closed";
+ if (conn.isClosed()) {
+ str = "connection is closed";
} else {
final StringBuffer sb = new StringBuffer();
sb.append(hashCode());
- final DatabaseMetaData meta = c.getMetaData();
+ final DatabaseMetaData meta = conn.getMetaData();
if (meta != null) {
sb.append(", URL=");
sb.append(meta.getURL());
@@ -107,19 +109,14 @@
sb.append(meta.getUserName());
sb.append(", ");
sb.append(meta.getDriverName());
- s = sb.toString();
+ str = sb.toString();
}
}
} catch (final SQLException ex) {
// Ignore
}
}
-
- if (s == null) {
- s = super.toString();
- }
-
- return s;
+ return str != null ? str : super.toString();
}
/**
@@ -142,6 +139,7 @@
* connection to compare innermost delegate with
* @return true if innermost delegate equals c
*/
+ @SuppressWarnings("resource")
public boolean innermostDelegateEquals(final Connection c) {
final Connection innerCon = getInnermostDelegateInternal();
if (innerCon == null) {
@@ -174,15 +172,16 @@
*
* @return innermost delegate.
*/
+ @SuppressWarnings("resource")
public final Connection getInnermostDelegateInternal() {
- Connection c = connection;
- while (c != null && c instanceof DelegatingConnection) {
- c = ((DelegatingConnection>) c).getDelegateInternal();
- if (this == c) {
+ Connection conn = connection;
+ while (conn != null && conn instanceof DelegatingConnection) {
+ conn = ((DelegatingConnection>) conn).getDelegateInternal();
+ if (this == conn) {
return null;
}
}
- return c;
+ return conn;
}
/**
@@ -251,6 +250,18 @@
throw e;
}
+ /**
+ * Handles the given {@code SQLException}.
+ *
+ * @param The throwable type.
+ * @param e The SQLException
+ * @return the given {@code SQLException}
+ * @since 2.7.0
+ */
+ protected T handleExceptionNoThrow(final T e) {
+ return e;
+ }
+
private void initializeStatement(final DelegatingStatement ds) throws SQLException {
if (defaultQueryTimeoutSeconds != null && defaultQueryTimeoutSeconds.intValue() != ds.getQueryTimeout()) {
ds.setQueryTimeout(defaultQueryTimeoutSeconds.intValue());
@@ -606,23 +617,35 @@
}
protected void passivate() throws SQLException {
- // The JDBC spec requires that a Connection close any open
+ // The JDBC specification requires that a Connection close any open
// Statement's when it is closed.
// DBCP-288. Not all the traced objects will be statements
final List traces = getTrace();
- if (traces != null && traces.size() > 0) {
+ if (traces != null && !traces.isEmpty()) {
+ final List thrown = new ArrayList<>();
final Iterator traceIter = traces.iterator();
while (traceIter.hasNext()) {
final Object trace = traceIter.next();
if (trace instanceof Statement) {
- ((Statement) trace).close();
+ try {
+ ((Statement) trace).close();
+ } catch (Exception e) {
+ thrown.add(e);
+ }
} else if (trace instanceof ResultSet) {
// DBCP-265: Need to close the result sets that are
// generated via DatabaseMetaData
- ((ResultSet) trace).close();
+ try {
+ ((ResultSet) trace).close();
+ } catch (Exception e) {
+ thrown.add(e);
+ }
}
}
clearTrace();
+ if (!thrown.isEmpty()) {
+ throw new SQLExceptionList(thrown);
+ }
}
setLastUsed(0);
}
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DelegatingResultSet.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DelegatingResultSet.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DelegatingResultSet.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DelegatingResultSet.java 2019-07-31 12:46:24.000000000 +0000
@@ -186,11 +186,11 @@
public void close() throws SQLException {
try {
if (statement != null) {
- ((AbandonedTrace) statement).removeTrace(this);
+ removeThisTrace(statement);
statement = null;
}
if (connection != null) {
- ((AbandonedTrace) connection).removeTrace(this);
+ removeThisTrace(connection);
connection = null;
}
resultSet.close();
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java 2019-07-31 12:46:24.000000000 +0000
@@ -21,6 +21,7 @@
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -125,35 +126,53 @@
if (isClosed()) {
return;
}
+ final List thrown = new ArrayList<>();
try {
- try {
- if (connection != null) {
- connection.removeTrace(this);
- connection = null;
- }
+ if (connection != null) {
+ connection.removeTrace(this);
+ connection = null;
+ }
- // The JDBC spec requires that a statement close any open
- // ResultSet's when it is closed.
- // FIXME The PreparedStatement we're wrapping should handle this for us.
- // See bug 17301 for what could happen when ResultSets are closed twice.
- final List resultSets = getTrace();
- if (resultSets != null) {
- final ResultSet[] set = resultSets.toArray(new ResultSet[resultSets.size()]);
- for (final ResultSet element : set) {
- element.close();
+ // The JDBC spec requires that a statement close any open
+ // ResultSet's when it is closed.
+ // FIXME The PreparedStatement we're wrapping should handle this for us.
+ // See bug 17301 for what could happen when ResultSets are closed twice.
+ final List resultSetList = getTrace();
+ if (resultSetList != null) {
+ final int size = resultSetList.size();
+ final ResultSet[] resultSets = resultSetList.toArray(new ResultSet[size]);
+ for (final ResultSet resultSet : resultSets) {
+ if (resultSet != null) {
+ try {
+ resultSet.close();
+ } catch (Exception e) {
+ if (connection != null) {
+ // Does not rethrow e.
+ connection.handleExceptionNoThrow(e);
+ }
+ thrown.add(e);
+ }
}
- clearTrace();
}
-
- if (statement != null) {
+ clearTrace();
+ }
+ if (statement != null) {
+ try {
statement.close();
+ } catch (Exception e) {
+ if (connection != null) {
+ // Does not rethrow e.
+ connection.handleExceptionNoThrow(e);
+ }
+ thrown.add(e);
}
- } catch (final SQLException e) {
- handleException(e);
}
} finally {
closed = true;
statement = null;
+ if (!thrown.isEmpty()) {
+ throw new SQLExceptionList(thrown);
+ }
}
}
@@ -615,7 +634,7 @@
}
/*
- * Note was protected prior to JDBC 4
+ * Note: This method was protected prior to JDBC 4.
*/
@Override
public boolean isClosed() throws SQLException {
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DriverConnectionFactory.java 2019-07-31 12:46:24.000000000 +0000
@@ -29,7 +29,9 @@
public class DriverConnectionFactory implements ConnectionFactory {
private final String connectionString;
+
private final Driver driver;
+
private final Properties properties;
/**
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DriverFactory.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DriverFactory.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/DriverFactory.java 1970-01-01 00:00:00.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/DriverFactory.java 2019-07-31 12:46:24.000000000 +0000
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.dbcp2;
+
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+/*
+ * Creates {@link Driver} instances.
+ *
+ * @since 2.7.0
+ */
+class DriverFactory {
+
+ static Driver createDriver(final BasicDataSource basicDataSource) throws SQLException {
+ // Load the JDBC driver class
+ Driver driverToUse = basicDataSource.getDriver();
+ String driverClassName = basicDataSource.getDriverClassName();
+ ClassLoader driverClassLoader = basicDataSource.getDriverClassLoader();
+ String url = basicDataSource.getUrl();
+
+ if (driverToUse == null) {
+ Class> driverFromCCL = null;
+ if (driverClassName != null) {
+ try {
+ try {
+ if (driverClassLoader == null) {
+ driverFromCCL = Class.forName(driverClassName);
+ } else {
+ driverFromCCL = Class.forName(driverClassName, true, driverClassLoader);
+ }
+ } catch (final ClassNotFoundException cnfe) {
+ driverFromCCL = Thread.currentThread().getContextClassLoader().loadClass(driverClassName);
+ }
+ } catch (final Exception t) {
+ final String message = "Cannot load JDBC driver class '" + driverClassName + "'";
+ basicDataSource.log(message, t);
+ throw new SQLException(message, t);
+ }
+ }
+
+ try {
+ if (driverFromCCL == null) {
+ driverToUse = DriverManager.getDriver(url);
+ } else {
+ // Usage of DriverManager is not possible, as it does not
+ // respect the ContextClassLoader
+ // N.B. This cast may cause ClassCastException which is
+ // handled below
+ driverToUse = (Driver) driverFromCCL.getConstructor().newInstance();
+ if (!driverToUse.acceptsURL(url)) {
+ throw new SQLException("No suitable driver", "08001");
+ }
+ }
+ } catch (final Exception t) {
+ final String message = "Cannot create JDBC driver of class '"
+ + (driverClassName != null ? driverClassName : "") + "' for connect URL '" + url + "'";
+ basicDataSource.log(message, t);
+ throw new SQLException(message, t);
+ }
+ }
+ return driverToUse;
+ }
+
+}
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/Jdbc41Bridge.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/Jdbc41Bridge.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/Jdbc41Bridge.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/Jdbc41Bridge.java 2019-07-31 12:46:24.000000000 +0000
@@ -304,7 +304,7 @@
return (T) resultSet.getURL(columnLabel);
}
throw new SQLFeatureNotSupportedException(
- String.format("resultSet=%s, columnLabel=%,d, type=%s", resultSet, columnLabel, type));
+ String.format("resultSet=%s, columnLabel=%s, type=%s", resultSet, columnLabel, type));
}
}
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java 2019-07-31 12:46:24.000000000 +0000
@@ -190,7 +190,7 @@
}
try {
- xaDataSourceInstance = (XADataSource) xaDataSourceClass.newInstance();
+ xaDataSourceInstance = (XADataSource) xaDataSourceClass.getConstructor().newInstance();
} catch (final Exception t) {
final String message = "Cannot create XA data source of class '" + xaDataSource + "'";
throw new SQLException(message, t);
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java 2019-07-31 12:46:24.000000000 +0000
@@ -65,6 +65,10 @@
}
/**
+ * Gets the transaction registry.
+ *
+ * @return The transaction registry.
+ * @see #setTransactionRegistry(TransactionRegistry)
* @since 2.6.0
*/
public TransactionRegistry getTransactionRegistry() {
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java 2019-07-31 12:46:24.000000000 +0000
@@ -29,9 +29,9 @@
import org.apache.commons.dbcp2.PoolingConnection;
import org.apache.commons.pool2.KeyedObjectPool;
import org.apache.commons.pool2.PooledObject;
+import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
-import org.apache.commons.pool2.impl.DefaultPooledObject;
/**
* A {@link PoolableConnectionFactory} that creates {@link PoolableManagedConnection}s.
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java 2019-07-31 12:46:24.000000000 +0000
@@ -18,6 +18,7 @@
package org.apache.commons.dbcp2;
import java.lang.management.ManagementFactory;
+import java.util.Objects;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
@@ -76,6 +77,14 @@
}
}
+ /**
+ * @since 2.7.0
+ */
+ @Override
+ public String toString() {
+ return Objects.toString(objectName);
+ }
+
public void unregisterMBean() {
if (MBEAN_SERVER == null || objectName == null) {
return;
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolableCallableStatement.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolableCallableStatement.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolableCallableStatement.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolableCallableStatement.java 2019-07-31 12:46:24.000000000 +0000
@@ -21,6 +21,7 @@
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.List;
import org.apache.commons.pool2.KeyedObjectPool;
@@ -67,9 +68,7 @@
// Remove from trace now because this statement will be
// added by the activate method.
- if (getConnectionInternal() != null) {
- getConnectionInternal().removeTrace(this);
- }
+ removeThisTrace(getConnectionInternal());
}
/**
@@ -115,21 +114,29 @@
@Override
public void passivate() throws SQLException {
setClosedInternal(true);
- if (getConnectionInternal() != null) {
- getConnectionInternal().removeTrace(this);
- }
+ removeThisTrace(getConnectionInternal());
// The JDBC spec requires that a statement close any open
// ResultSet's when it is closed.
// FIXME The PreparedStatement we're wrapping should handle this for us.
// See DBCP-10 for what could happen when ResultSets are closed twice.
- final List resultSets = getTrace();
- if (resultSets != null) {
- final ResultSet[] set = resultSets.toArray(new ResultSet[resultSets.size()]);
- for (final ResultSet element : set) {
- element.close();
+ final List resultSetList = getTrace();
+ if (resultSetList != null) {
+ final List thrown = new ArrayList<>();
+ final ResultSet[] resultSets = resultSetList.toArray(new ResultSet[resultSetList.size()]);
+ for (final ResultSet resultSet : resultSets) {
+ if (resultSet != null) {
+ try {
+ resultSet.close();
+ } catch (Exception e) {
+ thrown.add(e);
+ }
+ }
}
clearTrace();
+ if (!thrown.isEmpty()) {
+ throw new SQLExceptionList(thrown);
+ }
}
super.passivate();
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java 2019-07-31 12:46:24.000000000 +0000
@@ -32,9 +32,9 @@
import org.apache.commons.pool2.ObjectPool;
import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.PooledObjectFactory;
+import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
-import org.apache.commons.pool2.impl.DefaultPooledObject;
/**
* A {@link PooledObjectFactory} that creates {@link PoolableConnection}s.
@@ -312,7 +312,7 @@
}
}
}
-
+
/**
* @return Whether to auto-commit on return.
* @since 2.6.0
@@ -329,7 +329,7 @@
public boolean isEnableAutoCommitOnReturn() {
return autoCommitOnReturn;
}
-
+
/**
* True means that validation will fail immediately for connections that have previously thrown SQLExceptions with
* SQL_STATE indicating fatal disconnection errors.
@@ -342,14 +342,14 @@
public boolean isFastFailValidation() {
return fastFailValidation;
}
-
+
/**
* @return Whether to rollback on return.
*/
public boolean isRollbackOnReturn() {
return rollbackOnReturn;
}
-
+
@Override
public PooledObject makeObject() throws Exception {
Connection conn = connectionFactory.createConnection();
@@ -410,7 +410,7 @@
return new DefaultPooledObject<>(pc);
}
-
+
@Override
public void passivateObject(final PooledObject p) throws Exception {
@@ -440,15 +440,15 @@
conn.passivate();
}
-
+
public void setAutoCommitOnReturn(final boolean autoCommitOnReturn) {
this.autoCommitOnReturn = autoCommitOnReturn;
}
-
+
public void setCacheState(final boolean cacheState) {
this.cacheState = cacheState;
}
-
+
/**
* Sets the SQL statements I use to initialize newly created {@link Connection}s. Using {@code null} turns off
* connection initialization.
@@ -459,7 +459,7 @@
public void setConnectionInitSql(final Collection connectionInitSqls) {
this.connectionInitSqls = connectionInitSqls;
}
-
+
/**
* Sets the default "auto commit" setting for borrowed {@link Connection}s
*
@@ -469,7 +469,7 @@
public void setDefaultAutoCommit(final Boolean defaultAutoCommit) {
this.defaultAutoCommit = defaultAutoCommit;
}
-
+
/**
* Sets the default "catalog" setting for borrowed {@link Connection}s
*
@@ -479,7 +479,7 @@
public void setDefaultCatalog(final String defaultCatalog) {
this.defaultCatalog = defaultCatalog;
}
-
+
public void setDefaultQueryTimeout(final Integer defaultQueryTimeoutSeconds) {
this.defaultQueryTimeoutSeconds = defaultQueryTimeoutSeconds;
}
@@ -492,7 +492,7 @@
public void setDefaultReadOnly(final Boolean defaultReadOnly) {
this.defaultReadOnly = defaultReadOnly;
}
-
+
/**
* Sets the default "schema" setting for borrowed {@link Connection}s
*
@@ -503,7 +503,7 @@
public void setDefaultSchema(final String defaultSchema) {
this.defaultSchema = defaultSchema;
}
-
+
/**
* Sets the default "Transaction Isolation" setting for borrowed {@link Connection}s
*
@@ -513,7 +513,7 @@
public void setDefaultTransactionIsolation(final int defaultTransactionIsolation) {
this.defaultTransactionIsolation = defaultTransactionIsolation;
}
-
+
/**
* @param disconnectionSqlCodes
* The disconnection SQL codes.
@@ -523,7 +523,7 @@
public void setDisconnectionSqlCodes(final Collection disconnectionSqlCodes) {
this.disconnectionSqlCodes = disconnectionSqlCodes;
}
-
+
/**
* @param autoCommitOnReturn Whether to auto-commit on return.
* @deprecated Use {@link #setAutoCommitOnReturn(boolean)}.
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java 2019-07-31 12:46:24.000000000 +0000
@@ -20,6 +20,7 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.List;
import org.apache.commons.pool2.KeyedObjectPool;
@@ -29,6 +30,7 @@
* {@link PreparedStatement}s.
*
* My {@link #close} method returns me to my containing pool. (See {@link PoolingConnection}.)
+ *
*
* @param
* the key type
@@ -37,6 +39,7 @@
* @since 2.0
*/
public class PoolablePreparedStatement extends DelegatingPreparedStatement {
+
/**
* The {@link KeyedObjectPool} from which I was obtained.
*/
@@ -50,7 +53,7 @@
private volatile boolean batchAdded = false;
/**
- * Constructor
+ * Constructor.
*
* @param stmt
* my underlying {@link PreparedStatement}
@@ -69,9 +72,7 @@
// Remove from trace now because this statement will be
// added by the activate method.
- if (getConnectionInternal() != null) {
- getConnectionInternal().removeTrace(this);
- }
+ removeThisTrace(getConnectionInternal());
}
/**
@@ -128,21 +129,29 @@
clearBatch();
}
setClosedInternal(true);
- if (getConnectionInternal() != null) {
- getConnectionInternal().removeTrace(this);
- }
+ removeThisTrace(getConnectionInternal());
// The JDBC spec requires that a statement closes any open
// ResultSet's when it is closed.
// FIXME The PreparedStatement we're wrapping should handle this for us.
// See bug 17301 for what could happen when ResultSets are closed twice.
- final List resultSets = getTrace();
- if (resultSets != null) {
- final ResultSet[] set = resultSets.toArray(new ResultSet[resultSets.size()]);
- for (final ResultSet element : set) {
- element.close();
+ final List resultSetList = getTrace();
+ if (resultSetList != null) {
+ final List thrown = new ArrayList<>();
+ final ResultSet[] resultSets = resultSetList.toArray(new ResultSet[resultSetList.size()]);
+ for (final ResultSet resultSet : resultSets) {
+ if (resultSet != null) {
+ try {
+ resultSet.close();
+ } catch (Exception e) {
+ thrown.add(e);
+ }
+ }
}
clearTrace();
+ if (!thrown.isEmpty()) {
+ throw new SQLExceptionList(thrown);
+ }
}
super.passivate();
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/PoolingDataSource.java 2019-07-31 12:46:24.000000000 +0000
@@ -75,7 +75,7 @@
* @since 2.1
*/
@Override
- public void close() throws Exception {
+ public void close() throws RuntimeException, SQLException {
try {
pool.close();
} catch (final RuntimeException rte) {
diff -Nru commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/SQLExceptionList.java commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/SQLExceptionList.java
--- commons-dbcp2-2.6.0/src/main/java/org/apache/commons/dbcp2/SQLExceptionList.java 1970-01-01 00:00:00.000000000 +0000
+++ commons-dbcp2-2.7.0/src/main/java/org/apache/commons/dbcp2/SQLExceptionList.java 2019-07-31 12:46:24.000000000 +0000
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.dbcp2;
+
+import java.sql.SQLException;
+import java.util.List;
+
+/**
+ * A SQLException based on a list of Throwable causes.
+ *
+ * The first exception in the list is used as this exception's cause and is accessible with the usual
+ * {@link #getCause()} while the complete list is accessible with {@link #getCauseList()}.
+ *
+ *
+ * @since 2.7.0
+ */
+public class SQLExceptionList extends SQLException {
+
+ private static final long serialVersionUID = 1L;
+ private final List extends Throwable> causeList;
+
+ /**
+ * Creates a new exception caused by a list of exceptions.
+ *
+ * @param causeList a list of cause exceptions.
+ */
+ public SQLExceptionList(List extends Throwable> causeList) {
+ super(String.format("%,d exceptions: %s", causeList.size(), causeList), causeList.get(0));
+ this.causeList = causeList;
+ }
+
+ public List extends Throwable> getCauseList() {
+ return causeList;
+ }
+
+}
diff -Nru commons-dbcp2-2.6.0/src/site/site.xml commons-dbcp2-2.7.0/src/site/site.xml
--- commons-dbcp2-2.6.0/src/site/site.xml 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/site/site.xml 2019-07-31 12:46:24.000000000 +0000
@@ -1,60 +1,61 @@
-
-
-
-
-
- Commons DBCP
- /images/dbcp-logo-white.png
- /index.html
-
-
-
-
-
-
-
-
+
+
+
+
+
+ Commons DBCP
+ /images/dbcp-logo-white.png
+ /index.html
+
+
+
+
+
+
+
+
diff -Nru commons-dbcp2-2.6.0/src/site/xdoc/configuration.xml commons-dbcp2-2.7.0/src/site/xdoc/configuration.xml
--- commons-dbcp2-2.6.0/src/site/xdoc/configuration.xml 2019-02-15 15:02:23.000000000 +0000
+++ commons-dbcp2-2.7.0/src/site/xdoc/configuration.xml 2019-07-31 12:46:24.000000000 +0000
@@ -498,6 +498,14 @@
fastFailValidation is set to true.
+
+
jmxName
+
+
+ Registers the DataSource as JMX MBean under specified name. The name has to conform to the JMX Object Name Syntax (see
+ javadoc).
+
- We recommend you use a mirror to download our release
- builds, but you mustverify the integrity of
- the downloaded files using signatures downloaded from our main
- distribution directories. Recent releases (48 hours) may not yet
- be available from all the mirrors.
-
-
-
- You are currently using [preferred]. If you
- encounter a problem with this mirror, please select another
- mirror. If all mirrors are failing, there are backup
- mirrors (at the end of the mirrors list) that should be
- available.
-
- [if-any logo][end]
-
-
-
-
-
- It is essential that you
- verify the integrity
- of downloaded files, preferably using the PGP signature (*.asc files);
- failing that using the SHA256 hash (*.sha256 checksum files).
-
-
- The KEYS
- file contains the public PGP keys used by Apache Commons developers
- to sign releases.
-
+ We recommend you use a mirror to download our release
+ builds, but you mustverify the integrity of
+ the downloaded files using signatures downloaded from our main
+ distribution directories. Recent releases (48 hours) may not yet
+ be available from all the mirrors.
+
+
+
+ You are currently using [preferred]. If you
+ encounter a problem with this mirror, please select another
+ mirror. If all mirrors are failing, there are backup
+ mirrors (at the end of the mirrors list) that should be
+ available.
+
+ [if-any logo][end]
+
+
+
+
+
+ It is essential that you
+ verify the integrity
+ of downloaded files, preferably using the PGP signature (*.asc files);
+ failing that using the SHA256 hash (*.sha256 checksum files).
+
+
+ The KEYS
+ file contains the public PGP keys used by Apache Commons developers
+ to sign releases.
+
Many Apache projects support interaction with a relational database.
-Creating a new connection for each user can be time consuming (often
-requiring multiple seconds of clock time), in order to perform a database
-transaction that might take milliseconds. Opening a connection per user
-can be unfeasible in a publicly-hosted Internet application where the
-number of simultaneous users can be very large. Accordingly, developers
-often wish to share a "pool" of open connections between all of the
-application's current users. The number of users actually performing
-a request at any given time is usually a very small percentage of the
-total number of active users, and during request processing is the only
-time that a database connection is required. The application itself logs
-into the DBMS, and handles any user account issues internally.
-
-
There are several Database Connection Pools already available, both
-within Apache products and elsewhere. This Commons package provides an
-opportunity to coordinate the efforts required to create and maintain an
-efficient, feature-rich package under the ASF license.
-
-
The commons-dbcp2 package relies on code in the
-commons-pool2 package to provide the underlying object pool
-mechanisms that it utilizes.
-
-
DBCP now comes in four different versions to support different versions of
-JDBC. Here is how it works:
-
-
DBCP 2.6.0 compiles and runs under Java 8 only (JDBC 4.2)
-
DBCP 2.5.0 compiles and runs under Java 8 only (JDBC 4.2)
-
DBCP 2.4.0 compiles and runs under Java 7 only (JDBC 4.1)
-
DBCP 1.4 compiles and runs under Java 6 only (JDBC 4)
-
DBCP 1.3 compiles and runs under Java 1.4-5.0 only (JDBC 3)
-
-
-
DBCP 2.6.0 binaries should be used by applications running on Java 8 and above.
-
DBCP 2.5.0 binaries should be used by applications running under Java 8.
-
DBCP 2.4.0 binaries should be used by applications running under Java 7.
-
DBCP 1.4 binaries should be used by applications running under Java 6.
-
DBCP 1.3 should be used when running under Java 1.4 and 5.0.
-
-
DBCP 2 is based on Commons Pool 2 and provides increased performance, JMX
-support as well as numerous other new features compared to DBCP 1.x. Users
-upgrading to 2.x should be aware that the Java package name has changed, as well
-as the Maven co-ordinates, since DBCP 2.x is not binary compatible with DBCP
-1.x. Users should also be aware that some configuration options (e.g. maxActive
-to maxTotal) have been renamed to align them with the new names used by Commons
-Pool 2.
-
-
There is no difference in the codebase supporting DBCP 1.4.x and 1.3.x other
-than that the code implementing methods added to support JDBC 4 has been
-filtered out of the DBCP 1.3 sources.
-
-
-
-
-
- See the downloads page for information on
- obtaining releases.
-
-
-
-
-
-
The
-Javadoc API documents
-are available online. In particular, you should
-read the package overview of the
-org.apache.commons.dbcp2
-package for an overview of how to use DBCP.
Many Apache projects support interaction with a relational database.
+Creating a new connection for each user can be time consuming (often
+requiring multiple seconds of clock time), in order to perform a database
+transaction that might take milliseconds. Opening a connection per user
+can be unfeasible in a publicly-hosted Internet application where the
+number of simultaneous users can be very large. Accordingly, developers
+often wish to share a "pool" of open connections between all of the
+application's current users. The number of users actually performing
+a request at any given time is usually a very small percentage of the
+total number of active users, and during request processing is the only
+time that a database connection is required. The application itself logs
+into the DBMS, and handles any user account issues internally.
+
+
There are several Database Connection Pools already available, both
+within Apache products and elsewhere. This Commons package provides an
+opportunity to coordinate the efforts required to create and maintain an
+efficient, feature-rich package under the ASF license.
+
+
The commons-dbcp2 package relies on code in the
+commons-pool2 package to provide the underlying object pool
+mechanisms that it utilizes.
+
+
DBCP now comes in four different versions to support different versions of
+JDBC. Here is how it works:
+
+
DBCP 2.7.0 compiles and runs under Java 8 only (JDBC 4.2)
+
DBCP 2.6.0 compiles and runs under Java 8 only (JDBC 4.2)
+
DBCP 2.5.0 compiles and runs under Java 8 only (JDBC 4.2)
+
DBCP 2.4.0 compiles and runs under Java 7 only (JDBC 4.1)
+
DBCP 1.4 compiles and runs under Java 6 only (JDBC 4)
+
DBCP 1.3 compiles and runs under Java 1.4-5.0 only (JDBC 3)
+
+
+
DBCP 2.7.0 binaries should be used by applications running on Java 8 and above.
+
DBCP 2.6.0 binaries should be used by applications running on Java 8 and above.
+
DBCP 2.5.0 binaries should be used by applications running under Java 8.
+
DBCP 2.4.0 binaries should be used by applications running under Java 7.
+
DBCP 1.4 binaries should be used by applications running under Java 6.
+
DBCP 1.3 should be used when running under Java 1.4 and 5.0.
+
+
DBCP 2 is based on Commons Pool 2 and provides increased performance, JMX
+support as well as numerous other new features compared to DBCP 1.x. Users
+upgrading to 2.x should be aware that the Java package name has changed, as well
+as the Maven co-ordinates, since DBCP 2.x is not binary compatible with DBCP
+1.x. Users should also be aware that some configuration options (e.g. maxActive
+to maxTotal) have been renamed to align them with the new names used by Commons
+Pool 2.
+
+
There is no difference in the codebase supporting DBCP 1.4.x and 1.3.x other
+than that the code implementing methods added to support JDBC 4 has been
+filtered out of the DBCP 1.3 sources.
+
+
+
+
+
+ See the downloads page for information on
+ obtaining releases.
+
+
+
+
+
+
The
+Javadoc API documents
+are available online. In particular, you should
+read the package overview of the
+org.apache.commons.dbcp2
+package for an overview of how to use DBCP.
- To use JIRA you may need to create an account
- (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically
- created and you can use the Forgot Password
- page to get a new password).
-
-
-
- If you would like to report a bug, or raise an enhancement request with
- Apache Commons DBCP please do the following:
-
-
Search existing open bugs.
- If you find your issue listed then please add a comment with your details.
+ To use JIRA you may need to create an account
+ (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically
+ created and you can use the Forgot Password
+ page to get a new password).
+
+
+
+ If you would like to report a bug, or raise an enhancement request with
+ Apache Commons DBCP please do the following:
+
+
Search existing open bugs.
+ If you find your issue listed then please add a comment with your details.
- Apache Commons DBCP shares mailing lists with all the other
- Commons Components.
- To make it easier for people to only read messages related to components they are interested in,
- the convention in Commons is to prefix the subject line of messages with the component's name,
- for example:
-
-
[dbcp] Problem with the ...
-
-
-
- Questions related to the usage of Apache Commons DBCP should be posted to the
- User List.
-
- The Developer List
- is for questions and discussion related to the development of Apache Commons DBCP.
-
- Please do not cross-post; developers are also subscribed to the user list.
-
- You must be subscribed to post to the mailing lists. Follow the Subscribe links below
- to subscribe.
-
-
- Note: please don't send patches or attachments to any of the mailing lists.
- Patches are best handled via the Issue Tracking system.
- Otherwise, please upload the file to a public server and include the URL in the mail.
-
-
-
-
-
- Please prefix the subject line of any messages for Apache Commons DBCP
- with [dbcp] - thanks!
-
-
-
+ Apache Commons DBCP shares mailing lists with all the other
+ Commons Components.
+ To make it easier for people to only read messages related to components they are interested in,
+ the convention in Commons is to prefix the subject line of messages with the component's name,
+ for example:
+
+
[dbcp] Problem with the ...
+
+
+
+ Questions related to the usage of Apache Commons DBCP should be posted to the
+ User List.
+
+ The Developer List
+ is for questions and discussion related to the development of Apache Commons DBCP.
+
+ Please do not cross-post; developers are also subscribed to the user list.
+
+ You must be subscribed to post to the mailing lists. Follow the Subscribe links below
+ to subscribe.
+
+
+ Note: please don't send patches or attachments to any of the mailing lists.
+ Patches are best handled via the Issue Tracking system.
+ Otherwise, please upload the file to a public server and include the URL in the mail.
+
+
+
+
+
+ Please prefix the subject line of any messages for Apache Commons DBCP
+ with [dbcp] - thanks!
+
+
+