Attached patch will extend the JDBCStore configuration possibilities to allow setting of all (arbitrary in fact) Commons DBCP configuration properties and to pass properties directly to the underlying JDBC-driver. This patch addresses the following issues: 1. Cannot set (or control usage of) the DBCP connection validation query After applying the patch, any DBCP properties like validationQuery, testOnBorrow, testWhileIdle, can be set in the Slide domain configuration with a "dbcp." prefix. Example nodestore config for Oracle: <parameter name="dbcpPooling">true</parameter> <parameter name="dbcp.maxWait">5000</parameter> <parameter name="dbcp.maxActive">50</parameter> <parameter name="dbcp.maxIdle">25</parameter> <parameter name="dbcp.validationQuery">SELECT 1 FROM DUAL</parameter> <parameter name="dbcp.testOnBorrow">true</parameter> <parameter name="dbcp.testOnReturn">false</parameter> <parameter name="dbcp.testWhileIdle">false</parameter> 2. Cannot pass properties to the JDBC-driver (With MySQL it was previously possible, but not all drivers support extending the JDBC URL with ?property=value. Oracle for one does not.) After applying the patch, it is now possible to pass a list of JDBC-driver properties from the Slide domain configuration through the "dbcp.connectionProperties" setting. The format is semicolon separated, eg "defaultRowPrefetch=30;disableDefineColumnType=true" for setting Oracle row-prefetching to 30 rows per server rountrip and switching to the Oracle-recommended default of disableDefineColumnType=true for the Oracle 10 JDBC thin-driver. 3. Shutting down the Slide JDBCStore does not shutdown DBCP pool After applying the patch, the DBCP pool will be decommisioned on the disconnect() call on a clean Slide exit (it can be reconnected by calling connect() and the isConnected semantics is updated so that connectIfNeeded will call connect() if the pool is down). 4. Synchronization issue when using DBCP in multiple JDBCStore- instances within a Domain Naming the DBCP connection pool with System.identityHashCode is not guaranteed to be unique withing the Domain. After applying the patch, the JDBCStore will use the DBPC BasicDataSource with a Store-local (protected instance var) reference and it will be guaranteed that each Store instance uses a unique DBCP DataSource/pool instance.
Created attachment 15312 [details] Improved usage of Commons DBCP Improved usage of Commons DBCP Connection-pooling in JDBCStore. Created against CVS HEAD rev1.23 of JDBCStore.java (Slide 2.2pre1).
Created attachment 15313 [details] Updated documentation with new DBCP configuration. Updated documentation with new DBCP configuration. Use CDATA section in forrest page template to avoid having to escape all nodes in PRE-sections for configuration examples.
Created attachment 15314 [details] Updated 2.2 release notes for new DBCP features Updated 2.2 release notes with new DBCP- and JDBC-configuration features.
Thanks for the good-looking patch Martin. It's been applied.