You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ovidiu Predescu <ov...@cup.hp.com> on 2001/01/22 07:02:33 UTC

Re: cocoon+mysql stability

On Sun, 21 Jan 2001 15:25:10 +0100, Roman Zamorski <ra...@tenbit.pl> wrote:

> I have the following problem: I've set up a cocoon envirioment on
> debian GNU/linux with apache 1.3.13 + jserv 1.1.2 + cocoon 1.8 + mysql
> 3.23.30 and it seems it looses ability of conecting to the database
> after 1-2 days of running... It gives me general java message:
> 
> Comunication link failure: java.io.Exception
> 
> When I investigated the case I got even stranger results - I wrote a
> small java program which connected to mysql dbms and performed some
> selects at the same time the cocoon denied to do the same!
> 
> I've thrown out exception handling in my cocoon taglib and it turned
> out that cocoon (or rather jserv?) was not able to find the class I've
> neeb using as a JDBC driver (org.gjt.mm.mysql) even though it works
> after jserv restarting...
> 
> Anyone have an idea? Should I download C1.81 from CVS, or bug the
> JServ guys?

This may be a well known problem with the way MySQL handles long lived
connections. Apparently MySQL recycle the connections by closing them down if
they are not used for some time (which I don't remember whether can be
configured or not).

The way I solved this problem in the past was to ask the connection if its
closed, using the isClosed() method, before doing any operation. In the case
the connection is closed, I would reconnect before executing the operation.

Hope this helps,
-- 
Ovidiu Predescu <ov...@cup.hp.com>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/