[sqlalchemy] Re: MySQL server has gone away

2014-03-18 Thread Ni Wesley
I tried all you said. Here is my code: engine = create_engine(db_url, pool_size=100,max_overflow=150,echo=engine_echo,pool_recycle=3600) And, in the beginning, I googled a lot and add this: def _ping_db(): #session.execute('show variables') try: session.execute('select 1') ex

[sqlalchemy] Re: Mysql server has gone away

2014-01-13 Thread Ni Wesley
I just find a solution that try to ping database server by select 1 every give time. Thanks all you guys. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalch

Re: [sqlalchemy] Re: MySQL server has gone away (again..)

2011-12-17 Thread Michael Bayer
On Dec 17, 2011, at 12:56 PM, Sharpek wrote: > Hi, > > I think it is not BEAKER problem, this is another trackback: it only happens because: a. MySQL timed out the connection. this takes eight hours and you have pool_recycle on so that's not it. b. someone actually restarted MySQL. I'm assu

[sqlalchemy] Re: MySQL server has gone away (again..)

2011-12-17 Thread Sharpek
Hi, I think it is not BEAKER problem, this is another trackback: 2011-12-17 18:54:05,371 INFO sqlalchemy.pool.QueuePool Invalidate connection <_mysql.connection open to 'localhost' at 2502c20> (reason: OperationalError:(2006, 'MySQL server has gone away')) 2011-12-17 18:54:05,372 INFO sqlalchemy.