commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cindy Ballreich <ci...@ballreich.net>
Subject RE: RE: DBCP Issues
Date Tue, 15 Apr 2003 20:20:36 GMT

Well, yes, but we do have some responsibility to make sure the configuration is correct. I
had a situation where I would lose my connection after a long period of idleness. After reading
the archives of this list and asking a few questions, I came up with the xml that you see
below. DBCP is now working properly for me.

What would be great would be some better docs and howtos about setting up and configuring
DBCP, but I suppose that would take away the sense of adventure.

Cindy


At 01:01 PM 4/15/03 -0600, travis@spaceprogram.com wrote:
>Shouldn't DBCP catch errors like this itself and deal with them?  Rather than breaking
our programs?
>
>Travis
>
>---- Original Message ----
>From: Cindy Ballreich <cindy@ballreich.net>
>Sent: 2003-04-15
>To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
>Subject: RE: DBCP Issues
>
>I was having a similar problem with MySQL. Here's my xml...
>          <Resource name="jdbc/myDatabase" auth="Container" type="javax.sql.DataSource"/>
>          <ResourceParams name="jdbc/myDatabase">
>            <parameter>
>              <name>factory</name>
>              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>            </parameter>
>            <parameter>
>              <name>username</name>
>              <value>dbUser</value>
>            </parameter>
>            <parameter>
>              <name>password</name>
>              <value>dbUserPassword</value>
>            </parameter>
>            <parameter>
>              <name>driverClassName</name>
>              <value>org.gjt.mm.mysql.Driver</value>
>            </parameter>
>            <parameter>
>              <name>url</name>
>              <value>jdbc:mysql://localhost/myDatabase</value>
>            </parameter>
>            <parameter>
>              <name>maxActive</name>
>              <value>100</value>
>            </parameter>
>            <parameter>
>              <name>maxIdle</name>
>              <value>10</value>
>            </parameter>
>            <parameter>
>              <name>maxWait</name>
>              <value>1000</value>
>            </parameter>
>            <parameter>
>              <name>removeAbandoned</name>
>              <value>true</value>
>            </parameter>
>            <parameter>
>              <name>removeAbandonedTimeout</name>
>              <value>5</value>
>            </parameter>
>            <parameter>
>              <name>logAbandoned</name>
>              <value>true</value>
>            </parameter>
>            <parameter>
>              <name>validationQuery</name>
>              <value>SELECT 1;</value>
>            </parameter>
>            <parameter>
>              <name>AutoReconnect</name>
>              <value>true</value>
>            </parameter>
>          </ResourceParams>
>
>
>
>At 12:46 PM 4/15/03 -0400, Chris Forbis wrote:
>>Ok after much research and test case writing is seems that due to something
>>with the Oracle jdbc 2 drivers (that come with 8i) and dbcp have a problem
>>once and a while and think the database connection is lost (when from the
>>oracle side I can see it has not been).  The checkOpen function in DBCP
>>throws an exception and my code stops working....  Now that said I would
>>like to try the new Oracle JDBC drivers that come with Oracle 9i but I have
>>not been able to get them to work.  The pool seems to not be able to create
>>any connection for some reason (so it returns nothing but null).  Has anyone
>>used a JDBC3 drivers from Oracle (the 9i drivers) with the pool?  If so do
>>you have your XML you could share :)
>>
>>Thanks
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>

Mime
View raw message