On Oct 14, 5:48 pm, Timmy Chan <timmy.cha...@gmail.com> wrote: > sorry if this is addressed, but i'm running > > apache2 > SQLAlchemy 0.5.8 > Pylons 1.0 > Python 2.5.2 > > and on a simple page (just retrieve data from DB), I get: > > Error - <class 'sqlalchemy.exc.OperationalError'>: (OperationalError) (2006, > 'MySQL server has gone away') > > every few other requests, not after a long time as other posts I've searched > for. I still added > > sqlalchemy.pool_recycle = 1800 > > but that did not fix the issue. After a fresh apache restart, every 5th or > 6th requests gets a 500 from the above error.
The most likely explanation is that you are holding connections and not returning them to the pool. After enough idle time has elapsed the connection was closed (possibly by a firewall) and no longer working, but you are still trying to use it. Close your connections and return them to the pool as soon as the current commands are completed. If you enable echo in your database engine, engine.echo=True you will get a huge amount of debugging data that will include information about connections. You should be able to determine which connections are not getting closed. > thanks -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.