tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Gardner" <>
Subject RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9
Date Tue, 27 Aug 2002 06:29:02 GMT
Hi Paul,

I don't have experience with this pool, but I have experienced this
disconnection problem with mysql. Got around it using the mysql parameter
autoReconnect=true. I would suggest trying either of the following:




If one is successful, please report back so that we know if it worked for
you or not.


--Jay Gardner

-----Original Message-----
From: Paul Phillips []
Sent: Monday, August 26, 2002 10:04 PM
To: Tomcat Users List
Subject: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc
connection pool when used with MySQL.  Apparently MySQL kills off stale
connections after an 8 hour period.  According to Mark Matthews (developer
of the jdbc-mysql driver), I need to configure the pool to sweep out the
stale connections, and initiate new ones.

I have looked and looked in vain for documentation for DBCP that would
explain how to set the configuration in my Tomcat server.xml file (using
JNDI) that would enable this.  I can't find anything.  I've tried examining
the source of DBCP, but I'm afraid that I can't figure it out.

My Tomcat server.xml file uses this configuration below, which is right out

>>From what I can tell, there are other parameters that  I can enter to force
the sweeping of stale connections.  However, I don't know what they are, or
how to use them.  If anyone can give me an example of the correct syntax
here, I would be very grateful, ( since my webapp dies every night, due to
this problem!)

Thanks --

Paul Phillips

(excerpt of server.xml...)

<Context path="/DBTest" docBase="DBTest"
        debug="5" reloadable="true" crossContext="true">

  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_DBTest_log." suffix=".txt"

  <Resource name="jdbc/TestDB"

  <ResourceParams name="jdbc/TestDB">



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message