tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: connection pool
Date Tue, 03 Apr 2007 19:28:36 GMT
MG--
You want to make sure your abandoned connections are properly re-cycled e.g.
To configure a DBCP DataSource so that abandoned dB connections are removed 
and recycled add the following paramater to the ResourceParams configuration 
for your DBCP DataSource Resource:


                 <parameter>
              <name>removeAbandoned</name>
              <value>true</value>
            </parameter>


http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html

MG --

----- Original Message ----- 
From: "Daniel Stephens" <danman06@gmail.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Monday, April 02, 2007 12:36 PM
Subject: Re: connection pool


> sorry if someone has already mentioned this, but you will probably have to
> add the testOnborrow Parameter. So that also means you have to use the
> ValidationQuery, etc... but it(the pool) should try to restablish a
> connection at that point.
>
> testOnBorrow will cause some more overhead, but it might resolve your
> problem.
>
> here's an example..
>
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>oracle.jdbc.driver.OracleDriver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbc:oracle:thin:@<host>:<port>:<sid></value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>john</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>doe</value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>5</value>
> </parameter>
> <parameter>
> <name>maxIdle</name>
> <value>5</value>
> </parameter>
> <parameter>
> <name>maxWait</name>
> <value>-1</value>
> </parameter>
> <parameter>
> <name>removeAbandoned</name>
> <value>true</value>
> </parameter>
> <parameter>
> <name>validationQuery</name>
> <value>select count(*) from dual</value>
> </parameter>
> <parameter>
> <name>testOnBorrow</name>
> <value>true</value>
> </parameter>
>
> On 3/19/07, Gioia, Michael <Michael.Gioia@childrens.harvard.edu> wrote:
>>
>> Hi, I'm new to tomcat and have a problem with keeping up the connection
>> to the database thru the connection pool.
>>
>>
>>
>> Almost every weekend the database gets bumped and the java app that were
>> running needs to have tomcat restarted to reconnect to the database thru
>> the connection pool.  When we come in on Monday tomcat and the database
>> are up and running, but the app will not connect to the database.
>>
>>
>>
>> Is there a way to reestablish the connection so our users don't have to
>> wait until we come in on Monday to restart tomcat?
>>
>>
>>
>> Many Thanks,
>>
>> MG
>>
>>
> 

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message