Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

ZMySQLDA thinks that MySQL has gone away

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


pedroleonlopez at gmail

Mar 26, 2007, 2:56 PM

Post #1 of 5 (2082 views)
Permalink
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.
Something similar in Zope3-Dev:
http://mail.zope.org/pipermail/zope3-dev/2005-December/017052.html
The solution:
http://mail.zope.org/pipermail/checkins/2006-September/004078.html

Traceback (innermost last):

- Module ZPublisher.Publish, line 194, in publish_module_standard
- Module ZPublisher.Publish, line 157, in publish
- Module Zope2.App.startup, line 243, in abort
- Module transaction._manager, line 107, in abort
- Module transaction._transaction, line 507, in abort
- Module transaction._transaction, line 580, in abort
- Module Shared.DC.ZRDB.TM, line 64, in abort
- Module Products.ZMySQLDA.db, line 389, in _abort

error: release unlocked lock

Other people with the problem:
http://mail.zope.org/pipermail/zope/2005-June/159762.html
http://dev.plone.org/plone/ticket/6263

It will be possible fix this? If not, how can I do the transactions with
MySQL? Maybe with sqlobject o sqlalchemy?
Sorry for my English and sorry for create a new thread (*ticino at hccnet.nl
*put this question on the list some days ago). Thanks in advance.

Peter Lion


bill at celestial

Mar 26, 2007, 2:59 PM

Post #2 of 5 (1989 views)
Permalink
Re: ZMySQLDA thinks that MySQL has gone away [In reply to]

On Mon, Mar 26, 2007, Pedro Le?n L?pez wrote:
>
> 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.

Given that mysql (or any other database) may well be restarted as part of
log rotation and cron maintenance, you may well want to not depend on
continuously open connections.

Bill
--
INTERNET: bill [at] Celestial Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676

``During times of universal deceit, telling the truth becomes
a revolutionary act.'' --George Orwell
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


dev101 at magma

Mar 26, 2007, 3:10 PM

Post #3 of 5 (1982 views)
Permalink
Re: ZMySQLDA thinks that MySQL has gone away [In reply to]

----- Original Message -----
From: "Pedro León López" <pedroleonlopez [at] gmail>
To: <zope-db [at] zope>
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

_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


dieter at handshake

Mar 27, 2007, 12:16 PM

Post #4 of 5 (1977 views)
Permalink
Re: ZMySQLDA thinks that MySQL has gone away [In reply to]

Pedro León López wrote at 2007-3-26 23:56 +0200:
> ...
> - Module Products.ZMySQLDA.db, line 389, in _abort
>
>error: release unlocked lock
>
>Other people with the problem:
>http://mail.zope.org/pipermail/zope/2005-June/159762.html
>http://dev.plone.org/plone/ticket/6263
>
>It will be possible fix this?

When I remember right (search the mailing list archives for verification!)
then there is a "ZMySQLDA" version around that fixes the problem.

We are using an (age old) version that does not have the problem.



--
Dieter
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db


pedroleonlopez at gmail

Apr 3, 2007, 6:04 PM

Post #5 of 5 (1952 views)
Permalink
Re: ZMySQLDA thinks that MySQL has gone away [In reply to]

Thanks for answers. Thanks Dieter.

Then, is possible to fix db.py (from ZMySQLDA).
I write to the list to give the fix's link if anybody needs it in a future:
http://sourceforge.net/tracker/index.php?func=detail&aid=1558521&group_id=22307&atid=374934

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.