tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: connection pool
Date Wed, 04 Apr 2007 22:48:46 GMT
Martin Gainty wrote:
> 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>
yeah, the problem with this is that the algorithm for the "abandoned" 
connections is quite fishy, you'll pretty much have to reach max 
connections before any abandoned removal is done.
but yes, that is what you need,

also set logAbandoned="true" so that you can get some info where your 
"leak" is
Filip
>
>
> 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
>>>
>>>
>>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.25/744 - Release Date: 4/3/2007 5:32 AM
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message