Hello, The only thing I can think of is that the repoze.who middleware was added in the wrong order. Please have a look at this example: https://bitbucket.org/Gustavo/whatpylonsproject/src/tip/pylonssecuredapp/config/middleware.py
I don't remember seeing that error before. Can you please paste the traceback if the location of the middleware is not the problem? Cheers. On Nov 14, 4:25 am, Josh Kelley <josh...@gmail.com> wrote: > 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.