Re: Re: Reusing connections quixote 2

Arturo FM <[email protected]> Tue, 7 Nov 2006 08:40:52 +0000 (GMT)
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
>I don't need cleanup but I've found that expecting a long-running db
>connection to stay open is unwise.  MySQL will unilaterally abandon
>connections after so many idle hours (12 or so), and if MySQL is
>restarted the connection is no longer valid either, while it appears
>open in the Quixote application until you do a query, at which point
>you get a "MySQL server has gone away" exception.  Unfortunately I
>didn't realize this when I wrote a few applications, so now I have a
>cron job that restarts them every N hours as a kludge.  The proper way
>would be to use a "smart reconnect" connection from SQLAlchemy or some
>other db modules.  These reconnect and retry the query if the
>connection is dead.

I think this issue is a limitation. I'm working with MySQL but "MySQL server has gone away" is a problem because I need to write a cron job or use a third party module for reconnect to database. On the other hand, I can open a connection, execute a query and close the connection but it isn't efficient because open a db connection cost very time. Can I use Medusa or Twisted for solve this problem?

Thank you very much for your answers

Regards,
Arturo..






		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com