db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralf Baumert <ralf.baum...@phlat-labs.de>
Subject Torque loses Initparameters after a while (?)
Date Sun, 01 Jun 2003 20:53:07 GMT
Dear Torque Geeks,

I've got a application running on Tomcat 4/MySQL/Torque 3.0.
http://www.phlat-labs.de/phlatcsm/index.jsp

It works well, but after some time Torque throws
"Timeout waiting for Connection null"

It seems like Torque loses its Init Params after a while. I tried to 
workaround like this in my jsps:

if (! Torque.isInit()) { Torque t = new Torque(); 
t.init(getServletContext().getInitParameter("torque-path")); }
Connection con = Torque.getConnection();
if (con == null) throw new PhlatException("Doh !");

Here's my Config:

The relevant entries in Torque.properties:
defaultMaxConnections=10
maxExpiryTime=120
connectionWaitTimeout=5
url = jdbc:mysql://myhostsomewhere/mydb?autoReconnect=true

MySQL is configured to kill idle Connections after 30 sec, that's why I use 
autoReconnect.

To init Torque, I use a Servlet that gets intantiated by Tomcat on Startup.
 <servlet>
    <servlet-name>torque-init</servlet-name>
    <servlet-class>phlatcms.TorqueInit</servlet-class>
    <load-on-startup>1</load-on-startup>
 </servlet>

Am I doing something utterly wrong ? Any suggestions are more than welcome.

regards,
Ralf.Baumert@phlat-labs.de


Mime
View raw message