[Zope-DB] ZMySQLDA thinks that MySQL has gone away

Jonathan dev101 at magma.ca
Mon Mar 26 18:10:18 EDT 2007


----- Original Message ----- 
From: "Pedro León López" <pedroleonlopez at gmail.com>
To: <zope-db at zope.org>
Sent: Monday, March 26, 2007 5:56 PM
Subject: [Zope-DB] ZMySQLDA thinks that MySQL has gone away


> Hello,
>
> I got this error when querying MySQL 5.0.26. I use Zope 2.9.4 and ZMysqlDA
> 2.0.9b3 (with MySQLdb 1.2.1_p2). MySQL do not gone away.
> This error only happens after exactly 8 hours of database inactivity. I
> found some information about this error.
> It seems is caused because MySQL close the connection after 8 hours, this
> time is stored at 'wait_timeout' system variable in the MySQL server.
> I'm doing an application for school where isn't there activity at night.
> Then db.py don't know this because it feels that connection is alive. 
> Maybe
> the solution is check the connection before db.query.

Very easy to create a simple DTML routine which accesses MySQL;  then set up 
a cron job to run that DTML routine every few hours.


Jonathan 



More information about the Zope-DB mailing list