commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: [DBCP] re-establish severed connections
Date Mon, 23 Feb 2009 23:08:24 GMT
John Cartwright wrote:
> I've added the following to the configuration:
> 
> testWhileIdle="true"
> timeBetweenEvictionRunsMillis="300000"
> minEvictableIdleTimeMillis="600000"
> 
> with the intention that any idle connections would be evicted and closed
> normally before the firewall terminated them.  Does specifying these
> enable the evictor thread? Does this seem like a reasonable approach?

The validation query on its own does nothing. Have you tried setting
testOnBorrow="true" ? That may be sufficient if you can live with a slight delay
if a broken connection needs to be refreshed.

Mark

> 
> Thanks!
> 
> --john
> 
> John Cartwright wrote:
>> Hello All,
>>
>> We've recently installed a firewall that terminates connections that
>> have not had any traffic for 30 minutes.  This has caused problems
>> with our connection-pooled webapps in tomcat, since the connections in
>> the pool get severed.  I added a validation query, but it seems like
>> the first request after a period of inactivity hangs and subsequent
>> requests work normally.
>>
>> I don't see any kind of "keepalive" setting for the pool - can someone
>> suggest a better strategy or settings to get around this problem?  I'm
>> using Oracle 10.2 and tomcat 6.0.18.  Here's my current configuration
>> w/in the context.xml.
>>
>> Thanks for any suggestions!
>>
>> --john
>>
>> <Resource name="jdbc/CHEETAH"
>>          type="javax.sql.DataSource"
>>          auth="Container"
>>          username="dbuser"
>>          password="dbpasswd"
>>          driverClassName="oracle.jdbc.OracleDriver"
>>          url="jdbc:oracle:thin:@myhost:1521:CHEETAH"
>>          maxActive="8"
>>          maxIdle="4"
>>          validationQuery="select 1 from dual" />
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 



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


Mime
View raw message