Version 25.0 (30/11/2019) - RECOMMENDED ======================================= * Catching-up with vibur-object-pool version 25.0. Version 24.0 (29/11/2019) ========================= * Fixed https://github.com/vibur/vibur-dbcp/issues/13 - problem with SQL queries parameters logging when inputs are not integers. * Minor other refactoring. * Catching-up with vibur-object-pool version; skipped version 23.0 for vibur-dbcp. Version 22.2 (05/05/2018) ========================= * Small performance update. Version 22.1 (30/03/2018) ========================= * Adopted changes / improvements from Vibur Object Pool 22.1. * Various other small improvements, refactoring, and javadoc updates. Version 22.0 (08/02/2018) ========================= * Added logLineRegex configuration option - the application can use this option in conjunction with the logTakenConnectionsOnTimeout option in order to filter the generated stack trace lines. * Added takenConnectionsFormatter configuration option - allows the application to implement custom formatting to String of the TakenConnection[] array. Note that the default formatter uses the logLineRegex for filtering. * Added GetConnectionTimeout programming hook that is invoked only if the call to DataSource.getConnection() timeouts. The application can use this hook to format and redirect the generated taken-connections log to a different than the usual log location, for example, to Amazon S3. Note that in order to enable the taken-connections tracking the application must set poolEnableConnectionTracking to true. The default hook uses the takenConnectionsFormatter; it can be disabled via setting logTakenConnectionsOnTimeout to false. * Fixed a bug in the CloseConnection hook takenNanos parameter calculation, before its value was sometimes incorrect. Version 21.3 (28/01/2018) ========================= * Fixed a minor bug in the ResultSet size calculation where the size was sometimes calculated off by one. Version 21.2 (29/11/2017) ========================= * Fixed a bug in the implicit closing of the current ResultSet functionality, introduced in version 21.0. * Fixed a rarely occurring bug related to the possibility of Statement.getResultSet() to return null. Version 21.1 (27/11/2017) ========================= * Added resultSetNanoTime parameter to the ResultSetRetrieval programming hook. This parameter complements the existing resultSetSize parameter and represents the total time taken to iterate over and process the retrieved ResultSet. Version 21.0 (22/11/2017) ========================= * Moved the getConnection() retry mechanism (for lazily created connections) from the ConnectionFactory level to the PoolOperations level - this improves the connections reuse in certain situations. * Implemented implicit closing of the current ResultSet when the parent Statement is closed. * Changed some configuration defaults: a) poolInitialSize 10 -> 5; b) poolMaxSize 100 -> 50; c) reducerTimeIntervalInSeconds 60 -> 30; d) reducerSamples 20 -> 15; e) connectionTimeoutInMs 30_000 -> 15_000; f) acquireRetryDelayInMs 1000 -> 500; * Adopted changes / improvements from Vibur Object Pool 21.0. * Various other small fixes, refactoring and improvements. Version 20.0 (26/09/2017) ========================= * Changed the behavior of getConnection(...) to throw an SQLException("...interrupted while getting SQL connection...") when the current thread is interrupted; it was throwing an SQLTimeoutException before. The thread interrupted status remains set / uncleared as it was before. Version 19.2 (14/09/2017) ========================= * Fixed a rarely occurring bug in ViburListener.getTakenConnections(). * Renamed one configuration option: a) defaultTransactionIsolationValue -> defaultTransactionIsolationIntValue (added Int before Value). * Various other logging improvements and refactoring. Version 19.1 (17/08/2017) ========================= * Fixed a rarely occurring NPE in DefaultHook.InitConnection, introduced in version 19.0. Version 19.0 (09/08/2017) ========================= * Change the invocation of InitConnection hook to cover cases when establishing the connection was unsuccessful. * Adapted the new functionality introduced in Vibur Object Pool 19.0 which allows the real time waited to obtain a connection from the pool to be reported back to the GetConnection hook. Before the time reported to GetConnection hook was sometimes "polluted" by the time taken to establish new connection to the database when the pool was lazily creating such. * Javadoc updates and clarifications, various logging improvements. Version 18.0 (28/06/2017) ========================= * Added getTakenConnectionsStackTraces() and getTakenConnections() to ViburDataSource interface. The taken Connection information now includes the takenNanoTime and lastAccessNanoTime, the thread that has taken the Connection and a Throwable representing the location (stack trace) at the moment when the Connection was taken. The application also has access to the taken Connection proxy and can close it forcefully if needed. * Removed ValidateConnection hook due to being underutilized. * Various other logging improvements and refactoring. Version 17.1 (23/06/2017) ========================= * Javadoc and logging improvements; other minor fixes and refactoring. * Adopted changes from Vibur Object Pool 17.1. Version 17.0 (05/04/2017) ========================= * Reimplemented the StatementExecution hook as an around advice (in terms of AOP) instead of being an after advice as before. Now any implemented by user StatementExecution hooks are responsible for using the supplied StatementProceedingPoint to pass the call to the intercepted Statement "execute..." method or to the next registered StatementExecution hook via something like: (proxy, method, args, sqlQuery, sqlQueryParams, proceed) -> { // Java 8 try { // do something before the real method execution, for example, increment a queriesInProcess counter // or start a stopwatch Object result = proceed.on(proxy, method, args, sqlQuery, sqlQueryParams, proceed); // execute it // examine a thrown SQLException if necessary, retry the Statement execution if appropriate, etc return result; } finally { // do something after the real method execution, for example, decrement a queriesInProcess counter // or stop a stopwatch } } This construct allows for easy execution of supplied by user before and after Statement execution logic. * Fixed a minor bug in building sqlQueryParams. * Various other small refactoring, javadoc updates and clarifications, source code clean-up. Version 16.2 (10/02/2017) ========================= * Small performance / memory consumption improvements on top of 16.1 release. * Fixed a minor bug in Statement caching. * Small refactoring - renamed proxy package to stproxy; javadoc updates and clarifications. Version 16.1 (11/01/2017) ========================= * Small performance improvements on top of 16.0 release. Version 16.0 (09/01/2017) ========================= * Performance improvements of the programming hooks (version 12.0 onwards) implementation. * Fixed a minor bug in the implementation of logAllStackTracesOnTimeout from last release. Version 15.0 (04/01/2017) ========================= * Added an sqlException param to the StatementExecution hook params. * Added ValidateConnection programming hook. * Added logAllStackTracesOnTimeout configuration option - allows in case of Connections exhaustion the application to log not only the stacktraces of the threads that are holding the currently taken Connections but also the stacktraces of all other threads in the JVM. This option is for troubleshooting purposes only as it may generate a VERY large log output. * Intercepted the executed SQL query string in the Connection and Statement InvocationHandlers; doesn't longer depend on the JDBC driver functionality from preparedStatement.toString(). * Various other refactoring and improvements. Version 14.0 (22/12/2016) ========================= * Added programming hooks for StatementExecution and ResultSetRetrieval which allow the application to receive notifications for all executed queries, their parameters (if enabled), and the queries execution time or the retrieved ResultSet size, respectively. * Extended the GetConnection and CloseConnection programming hooks with information for the time taken to get a Connection from the pool or the time for which the application has held the Connection before restoring it back to the pool, i.e., before calling Connection.close(); * Reimplemented the existing functionality of ViburLogger for logging of long lasting getConnection() calls, slow SQL queries, and large ResultSets through the above programming hooks. Removed ViburLogger interface and the implementing it BaseViburLogger class. * Renamed MethodHooksHolder to InvocationHooksHolder as well as the corresponding field in ViburConfig. Example of how to add a method invocation hook: viburDataSource.getInvocationHooks().addOnMethodInvocation(invocationHook); * Now all timing measurement in Vibur DBCP is done via System.nanoTime() instead of System.currentTimeMillis() and all logging that contains timing is formatted in milliseconds with up to 6 digits precision. * Various other refactoring and source code clean-up. Version 13.0 (23/11/2016) ========================= * Logging improvements in logTakenConnectionsOnTimeout: in case of Connections exhaustion this option will now log not only the stacktrace of the threads that have taken the Connections as at the moment of their taking, but also the current execution stacktrace of these threads, if the threads are still alive. * Various other logging improvements: a) all logs created by ConnectionFactory class now contain rawConnection as part of the logged messages which allows for easy filtering/grepping of such messages. These messages are logged at debug level. b) added taking/restoring rawConnection messages to PoolOperations. These messages are logged at trace level. c) added log message at debug level in ViburDBCPDataSource when taking non-pooled rawConnection. Version 12.0 (11/11/2016) ========================= * Refactored/reimplemented the existing Connection and method invocation hooks in order to allow for multiple hook callbacks to be registered (and subsequently invoked) at a single hook invocation point. Also included the timeTaken for native JDBC Connection establishing/closing to be reported back to the hook. Example of how to add Connection and method invocation hooks: viburDataSource.getConnHooks().addOnInit(connectionInitHook); viburDataSource.getMethodHooks().addOnInvocation(invocationHook); * Adopted Vibur Object Pool 12.0, particularly allowed for third-party concurrent collections such as the Conversant Disruptor to be used on the place of java.util.Queue/Deque as part of the ConcurrentPool implementation. Example of how to configure Conversant Disruptor after adding the required Maven dependency: viburDataSource.setConcurrentCollection(new MultithreadConcurrentQueueCollection(poolMaxSize)); * Changed the Maven dependency type for ConcurrentLinkedHashMap from compile to provided, this means that applications using the Statement caching feature will now need to provide/include the Maven dependency for CLHM. * Removed ExceptionListener due to being underutilized. * Small other performance improvements and bug fixes. Version 11.0 (15/09/2016) ========================= * Added driver and driverProperties configuration options to ViburConfig. These options allow for direct configuration/injection of the used by the application JDBC Driver and subsequently allow to bypass calling the DriverManager. * Added allowUnwrapping configuration option - controls the behaviour of the unwrap() method on all JDBC objects. * Added includeQueryParameters configuration option - enables or disables the inclusion of the SQL query parameters in the generated logs. * Added logTakenConnectionsOnTimeout configuration option - allows in case of Connections exhaustion the application to log all currently taken Connections with optionally including the full stacktrace for each taken Connection. * Added invocationHook configuration option - a programming hook that allows the application to intercept all method calls on all proxied JDBC interfaces. * Made the PoolService, ConnectionFactory, and PoolReducer optionally configurable/injectable in ViburConfig. * Various other small fixes and performance improvements. Particularly, have refactored the invocation handlers classes hierarchy. Version 10.0 (31/07/2016) ========================= * Added getNonPooledConnection() and severConnection() methods in the ViburDataSource interface. These methods are an extension to the standard DataSource interface methods and allow for creation of a non-pooled/raw JDBC Connection on demand or for severing of a pooled or non-pooled Connection. * Added allowConnectionAfterTermination configuration option to ViburConfig. This option allows the application to obtain a non-pooled Connection from the pool after the pool termination. * Various refactoring, importantly renamed some classes in the org.vibur.dbcp package to remove the middle DBCP name part. Have also renamed DataSourceLifecycle to ViburDataSource. * Implemented close()/isClosed() methods in the StatementCache class. * Some performance improvements and minor bug fixes. Version 9.0 (02/05/2016) ======================== * This version of Vibur DBCP depends on version 9.0 of Vibur Object Pool, which contains a fix for issue #2 (close the underlying physical Connection when closing a proxy Connection after pool termination), and a new configuration option that allows to choose the underlying data structure used by the pool to be either FIFO (the old default) or LIFO (the new default). * Changed the default value of the connectionIdleLimitInSeconds configuration option from 15 to 5 seconds. * Improved the SQLException messages and SQLState values when the accessed connection pool is terminated or not started yet. * Implemented unregistering of the connection pool from JMX when the pool is terminated. * Added useNetworkTimeout and networkTimeoutExecutor configuration options in order to provide support for setting the socket level read-timeouts via using the Connection.setNetworkTimeout() method, for the case when the JDBC Connection is validated with a custom SQL query; i.e., different than isValid. * Migrated the source code base to Java 1.7 and implemented AutoCloseable for ViburDBCPDataSource. Various other small fixes, refactoring and javadoc updates. Version 8.0 (02/02/2016) - important bug fixing release ======================================================= * Fixed issue https://github.com/vibur/vibur-dbcp/issues/7 - statement/resource leak when statement cache is disabled. This was a REGRESSION BUG introduced in version 5.0 and existing until 7.0 inclusive. This release is distributed as a new major version to better convey the importance to upgrade the Vibur DBCP version for all users of versions 5.0 till 7.0. * Minor other refactoring and updates. Version 7.0 (10/01/2016) ======================== * This is a small changes only release, which is distributed as a new major version mainly due to the bug introduced in version 6.0 and subsequently fixed in 6.1. * Exception logging improvements and logging level changes. * Dependencies versions updates and small refactoring. Version 6.1 (05/01/2016) ======================== * Fixed a bug introduced in version 6.0 where the ExceptionCollector object was shared between all JDBC Connection objects in the pool. As a side effect of this bug, when an Exception is thrown on a particular JDBC Connection object, this will later cause the next taken from the pool JDBC Connection to be physically closed when the Connection.close() method is called - the last will cause overall performance degradation of the pool operations. * The ExceptionCollector interface was renamed to ExceptionListener in order to better convey the exact purpose of this facility. Version 6.0 (19/12/2015) ======================== * Introduced ConnectionHooks for: a) initConnection - will be invoked only once when the raw JDBC Connection is first created. This is the place to execute an application specific one-off Connection setup logic, such as setting the default Connection network timeout or similar. b) getConnection - will be invoked on the raw JDBC Connection as part of the DataSource.getConnection() flow. This is the place to execute an application specific per taken Connection setup logic, such as setting the default database schema or role, if they vary for each getConnection() call. c) closeConnection - will be invoked on the raw JDBC Connection as part of the Connection.close() flow. This is the place to execute an application specific per taken Connection winding down logic, if needed. * Introduced ViburLogger - allows the application to receive notifications for all long lasting getConnection() calls, slow SQL queries, or retrieved large ResultSets. This feature can be used by the application to accumulate statistics of the count and execution time of the SQL queries, or similar. * Introduced ExceptionCollector - allows the application to receive notifications for all exceptions thrown by the operations invoked on a JDBC Connection object or any of its derivative objects (e.g., Statement, ResultSet, MetaData). * Fixed issue #5 - configureFromProperties throws an Exception when configured as a JNDI resource. * Fixed a bug where equals/hashcode cannot be called on closed JDBC objects. Version 5.0 (24/10/2015) ======================== * Implemented Hibernate 5+ integration (as a separate project). See http://www.vibur.org/#hibernate-integration-artifacts for more details. * Implemented support for different usernames/passwords when calling DataSource.getConnection(username, password). See https://github.com/vibur/vibur-dbcp/issues/2#issuecomment-150200148 for more details. * Some refactoring and javadoc updates. Particularly, have extracted and encapsulated all JDBC Statement caching logic in the StatementCache class. Version 4.0 (08/08/2015) ======================== * poolReducerClass is now configurable. This is the fully qualified pool reducer class name. This pool reducer class will be instantiated via reflection. It must implement the ThreadedPoolReducer interface and must also have a public constructor accepting a single argument of type ViburDBCPConfig. * Various other refactoring and source code clean-up. Version 3.0 (03/06/2015) ======================== * Implemented logLargeResultSet config option. This option allows SQL queries that have retrieved larger than a given limit ResultSet to be logged, including their concrete parameters, and optionally with the full stacktrace of their execution. This option accompanies the logQueryExecutionLongerThanMs option, that logs SQL queries which execution has taken longer than a given time limit, and the logConnectionLongerThanMs option, that logs calls to the getConnection() method which have taken longer than a specified time. * Implemented validateTimeoutInSeconds config option. This timeout value is passed to the testConnectionQuery (which defaults to Connection.isValid(int)) that is executed when a taken from the pool JDBC Connection needs to be validated before use. * Implemented clearSQLWarnings config option - controls the clearing of the SQL warnings (if any) from the JDBC Connection or Statement after use. * Various logging improvements, including logging of the concrete SQL query parameters, if the underlying query execution has thrown an SQL Exception. * Have standardized all important warning messages to include information about the pool name, the number of currently taken from the pool Connections, and the number of remaining created in the pool Connections, in the following format: poolName (taken/remainingCreated). * Various refactoring, source code simplifications, and small fixes. * In order to better convey and suggest the client applications to upgrade when a new project version is out, have migrated the project to single digit version numbers via dropping the 1. version prefix. Version 1.2.0 (09/07/2014) ========================== * Reporting of slow SQL queries now includes the concrete queries parameters. * Additional work and improvements on JDBC statement caching. * Various improvements in logging and exceptions handling. Version 1.1.1 (15/06/2014) ========================== * Improvements and fixes in the JDBC Statements caching model. Version 1.1.0 (02/06/2014) ========================== * Vibur DBCP is now built and distributed as a valid R4 OSGi bundle. * Implemented Hibernate 4.3+ integration (as a separate project). PLEASE NOTE that the name of the artifact providing integration for Hibernate 4.0-4.2 has changed. See http://www.vibur.org/#hibernate-integration-artifacts for more details. * Retrofitted Vibur DBCP to use the new version 2.0 of Vibur Object Pool. * driverClassName config property was reestablished as an optional config property. This property is needed when Vibur DBCP is used in an OSGi container, and may also be helpful when Vibur DBCP is used in an Apache Tomcat web application. * JNDI ObjectFactory implemented - see ViburDBCPObjectFactory.java. * name (of the DataSource) and enableJMX config properties added. * loginTimeout config property added (used for the DriverManager or external DataSource configuration). * initSQL config property added (an SQL query that will be executed only once when a JDBC Connection is first created). * criticalSQLStates config property added (advanced). * Various other performance optimizations, small improvements and bug fixes. Version 1.0.0 (02/02/2014) ========================== * Implemented a pool drain (destroying all Connections) after a critical SQL server error. * Allowed for creation of the initial Connections in the pool from an existing/external DataSource. * Made poolReducer optional - config value of 0 disables it. * driverClassName config property was removed as it is not required when using Java 1.6+. * Implemented Hibernate4 integration (as a separate project). * Externalized the Hibernate3 integration as a separate project. Version 0.8.3 (15/11/2013) ========================== * Implemented the ResultSet returned by Statement interface methods as a dynamic proxy so that ResultSet.getStatement() will return the correct proxied Statement. * Implemented proper handling of Connection.isValid() method and made it the default option for Connection testing and verification. * Improved logging. * Various other refactoring and small improvements/optimizations. Version 0.8.2 (16/10/2013) ========================== * Fix to allow for exclusion of ConcurrentLinkedHashMap from maven dependencies. Version 0.8.1 (15/10/2013) ========================== * Bugs fixes and refactoring. * Simple JDBC Statements are not longer cached. Version 0.8.0 (28/09/2013) ========================== * Removed TransactionListener as being implemented incorrectly. * Changed some configuration defaults, introduced logQueryExecutionLongerThanMs. * Introduced logStackTraceForLongConnection and logStackTraceForLongQueryExecution. * Replaced MySQL with HyperSQL for unit/integration testing purposes. Version 0.7.2 (14/09/2013) ========================== * JMX implementation * Validation of Connection on take only if it has stayed idle in the pool for at least connectionIdleLimitInSeconds time. * Documentation update. * Adopted changes from vibur-object-pool 0.8.8 version, particularly the PoolReducer changes. Version 0.7.1 (12/08/2013) ========================== * Packages structure refactoring. Version 0.7.0 (26/07/2013) ========================== * First tagged release.