Apache Commons logo Commons DBCP

Commons DBCP Release Notes

Release History

Version Date Description
2.0 3 March 2014 This release includes new features as well as bug fixes and enhancements. Version 2.0.x supports JDBC 4.1, so requires Java 7. The Java package name has been changed from 'org.apache.commons.dbcp' to 'org.apache.commons.dbcp2'. Also the Maven groupId is now 'org.apache.commons' and the artifactId is 'commons-dbcp2' These changes are necessary because the API is not strictly binary compatible with the 1.x releases. To convert from the earlier releases, update the package name in imports, update the dependencies and recompile. There may be a few other changes to be made. Applications running under Java 7 should use DBCP 2.0.x. Java 6 users should use DBCP 1.4.x which supports JDBC 4. Java 1.4 and Java 5 users should use DBCP 1.3.x which supports JDBC 3.
1.5.1 not yet released TBD
1.4.1 not yet released TBD
1.4 2010-02-14 This release includes new features as well as bug fixes and enhancements. Some bug fixes change semantics (e.g. connection close is now idempotent). The 1.3 and 1.4 releases of DBCP are built from the same sources. Version 1.4 supports JDBC 4, so requires JDK 1.6. Applications running under JDK 1.4-1.5 must use DBCP 1.3. Applications running under JDK 1.6 should use DBCP 1.4. Other than support for the added methods in JDBC 4, there is nothing new or different in DBCP 1.4 vs. DBCP 1.3. The list of changes below since 1.2.2 applies to both the 1.3 and 1.4 release. Other than the one issue related to adding JDBC 4 support (DBCP-191), all bug fixes or new features are included in both DBCP 1.3 and 1.4
1.3 2010-02-14 Compatability release for JDBC 3. See version 1.4 description and change log.
1.2.2 2007-04-04 This is a maintenance release containing bug fixes and enhancements. All API changes are binary compatible with version 1.2.1.
1.2.1 2004-06-12 Maintenance Release to restore JDK 1.3 compatibility
1.2 2004-06-07  
1.1 2003-10-20  
1.0 2002-08-12 Initial Release

Release 2.0 - 3 March 2014

Type Changes By
fix BasicManagedDataSource - unregister from JMX on close(). Fixes DBCP-411. sebb
fix Log validation failures of poolable connections. Fixes DBCP-154. markt
fix DelegatingStatement.close() fails with NPE if statement is null Fixes DBCP-403. sebb
fix CPDSConnectionFactory.validateObject(Object) ignores Throwable. Fixes DBCP-322. sebb
add 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. markt
fix Removed unnecessary synchronisation in BasicDataSource#createDataSource. Fixes DBCP-300. markt
update The Java package name has been changed from org.apache.commons.dbcp to org.apache.commons.dbcp2. markt
update Update to Commons Pool 2 (based on java.util.concurrent) to provide pooling functionality. markt
update Updated source code for Java 1.6 (added @Override & @Deprecated annotations). markt
update Removed JOCL support. markt
update Remove deprecated SQLNestedException. Fixes DBCP-143. markt
fix Fix threading issues with accessToUnderlyingConnectionAllowed attribute of PoolingDriver which is used to support unit testing. Fixes DBCP-384. markt
add 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). Fixes DBCP-292. markt
fix Fix thread safety issues in the SharedPoolDataSource and the PerUserPoolDataSource. Fixes DBCP-376. Thanks to Dave Oxley. markt
fix Allow accessToUnderlyingConnectionAllowed to be configured when configuration takes place via JNDI in a JavaEE container. Fixes DBCP-382. Thanks to Stefan Rempfer. markt
fix Fix threading issue when using multiple instances of the SharedPoolDataSource concurrently. Fixes DBCP-369. Thanks to Michael Pradel. markt
fix 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. Fixes DBCP-391. markt
fix Make all mutable fields private. Fixes DBCP-404. markt
fix Return BasicDataSource rather than DataSource from BasicDataSourceFactory so a cast is not required to use BasicDataSource specific methods. Fixes DBCP-364. markt
fix 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. Fixes DBCP-358. markt
add Expose the new Pool 2 property evictionPolicyClassName to enable more sophisticated eviction strategies to be used. Fixes DBCP-368. markt
add Add support for pooling PreparedStatements that use auto-generated keys. Fixes DBCP-406. Thanks to Steeve Beroard. markt
fix Enable JDBC resources that are no longer referenced by client code to be eligible for garbage collection. Fixes DBCP-180. markt
add Enable DBCP to work with a SecurityManager such that only DBCP needs to be granted the necessary permissions to communicate with the database. Fixes DBCP-177. markt
fix Correct path to Javadoc overview in build.xml. Fixes DBCP-410. Thanks to Andreas Sturmlechner. markt
fix 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. Fixes DBCP-234. markt
add Register pooled connections with JMX so that they may be forcibly closed via JMX if required. Fixes DBCP-219. markt
add 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. Fixes DBCP-373. markt
add Provide an option to control if autoCommit is always set to true when a connection is returned to the connection pool. Fixes DBCP-351. markt
add Provide an option to control if rollback is called when a connection is returned to the poll with autoCommit disabled. Fixes DBCP-399. markt
add Provide an option to set the default query timeout. Fixes DBCP-340. markt
fix Connection.isValid() should not throw an SQLException if the connection is closed. markt
fix 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. Fixes DBCP-357. markt
add Add support for validation testing database connections on creation. Fixes 249. markt

Release 1.5.1 - not yet released

Type Changes By
fix 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. Fixes DBCP-400. markt
fix Avoid multiple calls to Connection.getAutoCommit() in PoolableConnectionFactory.passivateObject() as it could be an expensive call. Fixes DBCP-405. markt
fix Use one line per statement for methods with multiple statements rather than using a single line. Fixes DBCP-392. markt
fix Expose all of the AbandonedConfig properties through a BasicDataSource. Fixes DBCP-396. markt
fix Correct implementation of DelegatingConnection.isWrapperFor() so it works correctly with older JDBC drivers. Fixes DBCP-380. Thanks to Balazs Zsoldos. markt
fix Correct implementation of DelegatingStatement.isWrapperFor(). Also fix DelegatingDatabaseMetaData.isWrapperFor() and DelegatingResultSet.isWrapperFor() that had the same problem. Fixes DBCP-347. Thanks to Robert Poskrobek. markt
fix LocalXAConnectionFactory does not properly check if Xid is equal to currentXid when resuming which may result in an XAException. Fixes DBCP-341. Thanks to Ioannis Canellos. markt
fix Ensure that the XAConnection is closed when the associated Connection is closed. Fixes DBCP-355. Thanks to Florent Guillaume. markt
fix Clarify Jaavdoc for isClosed() method of PoolableConnection. Fixes DBCP-398. markt
fix 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. Fixes DBCP-383. markt
fix Using batchUpdate() should not invalidate the PreparedStatement when it is returned to the pool. Fixes DBCP-372. markt
fix Improve documentation for JNDI example using BasicDataSource. Fixes DBCP-309. markt

Release 1.4.1 - not yet released

Type Changes By
update Exposed GenericObjectPool's softMinEvictableIdleTimeMillis property for configuration and use by BasicDataSource. Fixes DBCP-334. Thanks to Alberto Mozzone. psteitz
fix Made equals reflexive in DelegatingStatement (and subclasses), DelegatingMetaData, DelegatingResultSet and PoolingDriver#PoolGuardConnectionWrapper. Fixes DBCP-337. Thanks to Rob Gansevles. psteitz
fix 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. Fixes DBCP-342. Thanks to Byungchol Kim. psteitz
fix 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. Fixes DBCP-330. psteitz
fix Modified execute methods of Statement objects to ensure that whenever a statement is used, the lastUsed property of its parent connection is updated. Fixes DBCP-343. psteitz
fix Correctly implemented the option to configure the class loader used to load the JDBC driver. Fixes DBCP-333. markt
update 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. Fixes DBCP-346. Thanks to Ken Tatsushita. psteitz
fix Test transitive dependencies brought in by geronimo-transaction created version conflicts (commons logging and junit). These have been explicitly excluded in the POM. Fixes DBCP-344. Thanks to Jeremy Whiting. psteitz
fix 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. Fixes DBCP-348. Thanks to Eiji Takahashi. psteitz

Release 1.4 - 2010-02-14

Type Changes By
fix Eliminated poolKeys cache from PerUserPoolDataSource. Fixes DBCP-320. psteitz
fix Eliminated userKeys LRUMap cache from SharedPoolDataSource. Fixes DBCP-321. sebb
fix Made private fields final where possible. Fixes DBCP-319. Thanks to Sebastian Bazley. psteitz
fix PerUserPoolDataSource.getPooledConnectionAndInfo multi-threading bug. Fixes DBCP-318. Thanks to Sebastian Bazley. sebb
fix Remove throws clause from method that does not throw an exception. Fixes DBCP-315. Thanks to Sebastian Bazley. sebb
fix Remove code that catches and ignores Exceptions when calling PooledConnection.removeConnectionEventListener(ConnectionEventListener) as the method does not throw any Exceptions. Fixes DBCP-313. Thanks to Sebastian Bazley. sebb
fix Remove impossible null check. Fixes DBCP-316. Thanks to Sebastian Bazley. sebb
update Renamed variables with duplicate names in different scopes. Fixes DBCP-314. Thanks to Sebastian Bazley. sebb
update Clarified javadoc for BasicDataSource close() method. Fixes DBCP-312. Thanks to Glen Mazza. psteitz
add 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. Fixes DBCP-204. Thanks to Wei Chen. psteitz
update 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. Fixes DBCP-305. Thanks to Christopher Schultz. markt
fix Ensure Statement.getGeneratedKeys() works correctly with the CPDS adapter. Fixes DBCP-303. Thanks to Dave Oxley. markt
fix Removed incorrectly advertised ClassNotFoundException from JOCLContentHandler.ConstructorDetails.createObject(). Fixes DBCP-302. Thanks to Sebastian Bazley. psteitz
update Make the class loader used to load the JDBC driver configurable for the BasicDatasource. Fixes DBCP-203. Thanks to Mark Grand. markt
fix Handle user password changes for InstanceKeyDataSources. Fixes DBCP-8. markt
update Made XADataSource configurable in BasicManagedDataSource. Fixes DBCP-289. Thanks to Marc Kannegießer. psteitz
fix Added PoolableManagedConnection and PoolableManagedConnectionFactory so that pooled managed connections can unregister themselves from transaction registries, avoiding resource leaks. Fixes DBCP-294. Thanks to Philippe Mouawad. psteitz
update Added connectionProperties property to DriverAdapterCPDS. Fixes DBCP-276. psteitz
add Added a validationQueryTimeout configuration parameter to BasicDataSource allowing the user to specify a timeout value (in seconds) for connection validation queries. Fixes DBCP-226. psteitz
add 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. Fixes DBCP-175. Thanks to Jiri Melichna and Jerome Lacoste. psteitz
fix 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. Fixes DBCP-212. markt
fix Reverted DelegatingConnection close to 1.2.2 version to ensure open statements are closed before the underlying connection is closed. Fixes DBCP-242. psteitz
fix Refactor DelegatingConnection and ManagedConnection enable overridden equals() and hashcode() to work correctly. Fixes DBCP-235. markt
update Add a DelegatingDatabaseMetaData to track ResultSets returned from DatabaseMetaData objects. Fixes DBCP-265. markt
fix Modified BasicDataSourceFactory to complete initialization of the pool by creating initialSize connections rather than leaving this to lazy initialization when the pool is used. Fixes DBCP-215. markt
fix Eliminated masked _stmt field in descendents of DelegatingStatement. Fixes DBCP-253. markt
fix Modified DBCP sources to support compilation under JDK 1.4-1.6 using Ant flags to do conditional compilation. Fixes DBCP-191. Thanks to Michael Heuer and J. David Beutel. markt
fix 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. Fixes DBCP-272. markt
fix Eliminated direct System.out calls in AbandonedTrace. Fixes DBCP-4. markt
fix Modified DelegatingStatment close to clear open batches. Fixes DBCP-264. niallp
fix Eliminated unused private "parent" field in AbandonedTrace. Fixes DBCP-255. psteitz
fix 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. Fixes DBCP-273. Thanks to Mark Lin. psteitz
fix Made private instance fields of AbandonedTrace volatile (parent, createdBy, lastUsed, createdTime) or final (trace). Fixes DBCP-271. Thanks to Sebastian Bazley. psteitz
fix Narrowed synchronization in AbandonedTrace to resolve an Evictor deadlock. Fixes DBCP-270. Thanks to Filip Hanik. psteitz
fix Corrected Javadoc to state that getLoginTimeout and setLoginTimeout are NOT supported by BasicDataSource. Fixes DBCP-218. bayard
update 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+. Fixes DBCP-211. bayard
add Added support for pooling managed connections. Fixes DBCP-228. Thanks to Dain Sundstrom. psteitz
add 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. Fixes DBCP-230. Thanks to Dain Sundstrom. psteitz
update 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. Fixes DBCP-233. Thanks to Dain Sundstrom. psteitz
update 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(). Fixes DBCP-11. Thanks to Dain Sundstrom. psteitz
update SQLNestedException has been deprecated and will be replaced in DBCP 2.0 with SQLException and standard Java exception chaining. Fixes DBCP-143. dain
fix 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. Fixes DBCP-221. dain
fix Eliminated potential sources of NullPointerExceptions in PoolingConnection. Fixes DBCP-241. psteitz
fix 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. Fixes DBCP-216. Thanks to Marcos Sanz. psteitz
fix Fixed error in SharedPoolDataSource causing incorrect passwords to be stored under certain conditions. Fixes DBCP-245. Thanks to Michael Drechsel. psteitz
fix Added exception handler to ensure that PooledConnections are not orphaned when an exception occurs in setUpDefaults or clearWarnings in IntanceKeyDataSource.getConnection. Fixes DBCP-237. Thanks to Oliver Matz. psteitz
fix Made getPool synchronized in PoolableConnectionFactory. Fixes inconsistent synchronization accessing _pool. Fixes DBCP-252. Thanks to FindBugs. psteitz
fix 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. Fixes DBCP-252. Thanks to FindBugs. psteitz

Release 1.3 - 2010-02-14

Type Changes By
update 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.

Release 1.2.2 - 2007-04-04

Type Changes By
add Add a <i>JNDI How To</i> to the User Guide. dirkv
fix DriverManagerConnectionFactory: blank username/password handling. Fixes DBCP-108. Thanks to Maxwell Grender-Jones. dirkv
fix Broken behaviour for BasicDataSource.setMaxActive(0). Fixes DBCP-113. Thanks to Rohan Lenard. dirkv
fix BasicDataSource does not work with getConnection(String, String). Fixes DBCP-36. Thanks to Jonathan Whitall. dirkv
update Enhancements to prepared statement in DriverAdapterCPDS. Fixes DBCP-164. Thanks to Todd Carmichael. dirkv
update Better messages and docs for LoginTimeout UnsupportedOperationException. Fixes DBCP-186. Thanks to Ralf Hauser. yoavs
fix Error in JOCL snippet in org.apache.commons.dbcp package javadoc. Fixes DBCP-50. Thanks to Nicky Nicolson. yoavs
update Added toString() methods to DelegatingPreparedStatement and DelegatingStatement Fixes DBCP-165. Thanks to QM. yoavs
fix 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). yoavs
fix Per-user pooling with Oracle driver and default isolation settings. Fixes DBCP-20. Thanks to Chris Nappin. dirkv
fix Error in JOCL document in javadoc. Fixes DBCP-9. Thanks to Adrian Baker. dirkv
update Added toString() method to DelegatingConnection. sullis
update Add DriverManager.invalidateConnection(). Fixes DBCP-181. Thanks to Meikel Bisping. dirkv
fix Improved Exception nesting in ConnectionPool. Fixes DBCP-184. Thanks to Meikel Bisping. dirkv
fix Fix broken website links for examples. Fixes DBCP-144. Thanks to Sebb. dennisl
fix Modified PoolableConnection close method to invalidate instance when invoked on an already closed connection. Fixes DBCP-28. Thanks to Huw Lewis, James Ring. psteitz
fix Inserted null checks to avoid NPE in close operations. Fixes DBCP-81. joehni
fix Changed getReference method in InstanceKeyDataSource to return a concrete factory and added implementations of getReference in concrete subclasses. Fixes DBCP-105. Thanks to Sandy McArthur, Thomas Fischer. psteitz
fix Inserted null check in close method of SharedPoolDataSource to avoid NPE when invoked on non-initialized pool. Fixes DBCP-39. Thanks to Jindrich Vimr. psteitz
fix Document fact that true values for testOnBorrow, testOnReturn, testWhileIdle only have effect when validationQuery is set to a non-null string. Fixes DBCP-71. Thanks to Douglas Squirrel. psteitz
fix Modified activateObject in PoolableConnection to test connection properties before resetting to defaults. Fixes DBCP-102. psteitz
fix Corrected maxActive documentation in configuration.html. Fixes DBCP-188. sandymac
update Upgraded dependency to Pool 1.3. psteitz
update Added connection info to SQLException messages when closed connections (resp stmts) are accessed in DelegatingConnection, DelegatingStatement. Fixes DBCP-187. Thanks to Ralf Hauser. psteitz
fix 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. Fixes DBCP-41. Thanks to Anton Tagunov. psteitz
fix Made userKeys an instance variable (i.e., not static) in SharedPoolDataSource. Fixes DBCP-100. psteitz
fix Changed implementation of equals in PoolingDataSource.PoolGuardConnectionWrapper to ensure it is reflexive, even when wrapped connections are not DelegatingConnections. Fixes DBCP-198. psteitz
update 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. Fixes DBCP-116. Thanks to Thomas Fischer. psteitz
update Removed dependency on Commons Collections by adding collections 2.1 sources for LRUMap and SequencedHashMap with package scope to datasources package. Fixes DBCP-68. psteitz
fix 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. Fixes DBCP-65. psteitz

Release 1.2.1 - 2004-06-12

Type Changes By
fix See <a href="release-notes-1.2.1.html">DBCP 1.2.1 Release Notes</a> for details.

Release 1.2 - 2004-06-07

Type Changes By
update See <a href="release-notes-1.2.html">DBCP 1.2 Release Notes</a> for details.

Release 1.1 - 2003-10-20

Type Changes By
update See <a href="release-notes-1.1.html">DBCP 1.1 Release Notes</a> for details.

Release 1.0 - 2002-08-12

Type Changes By
add Initial Release