I'm getting the dreaded "MySQL server has gone away" and "Can't
reconnect until invalid transaction is rolled back" pair of errors in
my Pylons application.

>From what I've read online, the "Can't reconnect until invalid
transaction is rolled back" is supposed to be avoided by Pylons'
default lib/base.py wrapping each controller's operations in a

    try:
      ...
    finally:
      Session.remove()

block.  However, from what I can tell, I'm getting this error within
repoze.who's middleware (specifically, repose.who.plugins.sa's
_BaseSQLAlchemyPlugin.get_user), which I assume is executing outside
of this try / finally block, so Session is never removed or rolled
back, so the "Can't reconnect until invalid transaction is rolled
back" error is never cleared.

How do I fix this "invalid transaction" state?  I've read all of the
suggestions on handling "MySQL server has gone away" and will work on
those, but before I do so, I'd like to know that if an error does
somehow slip through, it won't leave my app in a broken "invalid
transaction" state.

--
Josh Kelley

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-disc...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to