commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Extance, Paul" <paul.exta...@spirent.com>
Subject RE: dbcp bug
Date Tue, 19 Aug 2003 19:01:17 GMT
We use the 'test on borrow' feature for cleaning up stale connections (see
example below from tomcat's server.xml)...You'll probably want to change the
validation query if you're not using oracle! We can now happly bounce the
database, and the application/web server don't care (unless the database is
being access at that point in time).

    <GlobalNamingResources>
        <Resource
            name = "dbcp/bip"
            auth = "Container"
            type = "javax.sql.DataSource"
        />
        <ResourceParams name = "dbcp/bip">
            <parameter>
                <name>factory</name>
 
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
            <parameter>
                <name>username</name>
                <value>BIPUSER</value>
            </parameter>
            <parameter>
                <name>password</name>
                <value>bipuser</value>
            </parameter>
            <parameter>
                <name>driverClassName</name>
                <value>oracle.jdbc.driver.OracleDriver</value>
            </parameter>
            <parameter>
                <name>url</name>
                <value>jdbc:oracle:thin:@xxx.yyy.com:1521:zzz</value>
            </parameter>
            <parameter>
                <name>maxActive</name>
                <value>32</value>
            </parameter>
            <parameter>
                <name>maxIdle</name>
                <value>4</value>
            </parameter>
            <parameter>
                <name>maxWait</name>
                <value>100</value>
            </parameter>
            <parameter>
                <name>testOnBorrow</name>
                <value>true</value>
            </parameter>
            <parameter>
                <name>testOnReturn</name>
                <value>true</value>
            </parameter>
            <parameter>
                <name>validationQuery</name>
                <value>select 1 from dual</value>
            </parameter>
        </ResourceParams>
    </GlobalNamingResources>


There is the "testWhileIdle", "timeBetweenEvictionRunsMillis" and
"numTestsPerEvictionRun" options that can be used for a more proactive
pruning of the pools, but I've not played with this. Here is a link to
explain these parameters
http://nagoya.apache.org/gump/javadoc/jakarta-commons/pool/dist/docs/api/org
/apache/commons/pool/impl/GenericObjectPool.html

I concur that an 'official' release would be good. I'm currently putting cvs
builds in production, since they contain critical bug fixes. :-)

Paul Extance

-----Original Message-----
From: KNOX, Liam, FM [mailto:Liam.Knox@rbos.com] 
Sent: Tuesday, August 19, 2003 1:24 AM
To: 'Jakarta Commons Developers List'
Subject: RE: dbcp bug

Noel

I took the latest snap shot and this seems to work fine. Is there a plan for
a new release in the near future?  I am also interested in how dbcp deals
with closed or 'stale'
connections i.e. in the event of a db outage.  Is it possible that stale
connections
could remain in the pool  ?

Thanks

Liam 

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com]
Sent: 18 August 2003 17:02
To: Jakarta Commons Developers List
Subject: RE: dbcp bug


Check this against the CVS.  There were recent changes to make sure that
operations were not performed on null references.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


****************************************************************************
*******
This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
             Regulated by the Financial Services Authority

            Visit our website at http://www.rbs.co.uk/CBFM/
****************************************************************************
*******


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org

Mime
View raw message