db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: Torque/MySQL connection hung after a week
Date Sat, 01 Nov 2008 10:32:00 GMT
This is probably the old mysql problem: Mysql shuts down connections after 
8 hours of inactivity (this is configurable but 8 hours is the standard 
setting). Depending on your pool configuration, it may not notice that the 
connections are dead, and may fail to evict them. In this case Martin's 
solution will do.

There is another possibility that in some rare condition (e.g. exceptions) 
you fail to return connections to the pool. This is hard to find; in this 
case you neet to check that each time a onnection is opened it is closed 
in sole finally clause.
If you do not explicitly use connections then Torque will do this for you.

   Thomas

Martin Tilsted wrote:
> I had a similary problem with torque 3.3, and fixed it with
> 
> torque.dsfactory.YOURDATABASE.pool.validationQuery=SELECT 1
> torque.dsfactory.YOURDATABASE.pool.testOnBorrow=true
> 
> I did a few other things with my code, but I am pretty sure it was these 

> 2 lines that fixed it.
> 
> Frank Nguyen wrote:
> > I use Tomcat 4.x + Torque 3.1.1 + MySQL (5.x). The # of frequent users 

> > is <10 but heavy; i.e. continuous 8hrs. My problem is that after a 
week 
> > or so, the db connection b/w Tomcat (Torque) and MySQL hung (Tomcat is 

> > still working fine w/ other transaction) and have to reboot. I 
> > experienced a lot w/ Torque.properties configuration; especially 
> > db-common section, but nothing helped. Attached is my 
Torque.properties 
> > file. Any help/pointers is greatly appreciated.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message