Diana Clarke wrote:
I'm a bit hesitant to share what I've done, b/c it's still a work in progress etc, but here goes:

    MySQL MyISAM, wait_timeout=28800

You have no transactions, so I'm not sure why you're worrying about them... Switch to InnoDB if you want transactions...

Finally, we're using pylons and are removing the contextual session in the finally clause of the base controller's __call__ method.

class BaseController(WSGIController):

    def __call__(self, environ, start_response):
        try:
            ...
        finally:
            session.remove()

Yeah, I'm trying to find out if this .remove() is actually necessary.

We only ever see 'MySQL server has gone away' on our idle failover app instances, as the only traffic they get are occasional pings from nagios. I would have thought a combination of wait_timeout & pool_recycle would prevent this... but I'm probably missing some piece of the big picture.

OperationalError: (OperationalError) (2006, 'MySQL server has gone away')

Indeed, I would have thought so too...

I do wonder how possible it would be wrt the open session in view etc to implement a reconnect on is_dissconect() in _handle_dbapi_exception()...

I can't see this as being safe, the state of your app may be inconsistent, you should probably retry the whole wsgi request from scratch when that happens...

...and I know Michael doesn't like that idea either ;-)

Chris

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to