commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wes Clark" <wcl...@guidewire.com>
Subject RE: [DBCP] re-establish severed connections
Date Mon, 23 Feb 2009 17:58:02 GMT

testWhileIdle=true,
timeBetweenEvictionRunsMillis=5000,
numTestsPerEvictionRun=5,
...

This will cause the idle object evictor thread to wake up every five
second, and test 5 threads with the validation query. We use this in our
application because we were having dead threads being given to the
application, as we don't test on borrow.  You may need to set the
minEvictableIdleTimeMillis to something other than the default, which is
30 minutes.

-----Original Message-----
From: John Cartwright [mailto:John.C.Cartwright@noaa.gov] 
Sent: Monday, February 23, 2009 8:38 AM
To: Commons Users List
Subject: [DBCP] re-establish severed connections

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


Mime
View raw message