Bug 35235 - Improved usage of Commons DBCP Connection-pooling in JDBCStore
Summary: Improved usage of Commons DBCP Connection-pooling in JDBCStore
Status: CLOSED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: Stores (show other bugs)
Version: Nightly
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL: http://www.mail-archive.com/slide-dev...
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2005-06-06 12:49 UTC by Martin Kal
Modified: 2005-06-13 06:56 UTC (History)
0 users



Attachments
Improved usage of Commons DBCP (20.34 KB, patch)
2005-06-06 12:51 UTC, Martin Kal
Details | Diff
Updated documentation with new DBCP configuration. (10.85 KB, patch)
2005-06-06 13:12 UTC, Martin Kal
Details | Diff
Updated 2.2 release notes for new DBCP features (839 bytes, patch)
2005-06-06 13:18 UTC, Martin Kal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kal 2005-06-06 12:49:54 UTC
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.
Comment 1 Martin Kal 2005-06-06 12:51:58 UTC
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).
Comment 2 Martin Kal 2005-06-06 13:12:39 UTC
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.
Comment 3 Martin Kal 2005-06-06 13:18:42 UTC
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.
Comment 4 Unico Hommes 2005-06-13 14:56:32 UTC
Thanks for the good-looking patch Martin. It's been applied.