On Aug 12, 2010, at 9:50 AM, Guyren G Howe wrote: > TurboGears 2.1. > > I'm seeing the unhelpful "Internal Error" message every seventh time I hit my > app. This appears to be because every time I hit the app, I'm leaving a > transaction open on the server. The only cure is to restart TurboGears. > > The Turbogears documentation *appears* to state that this is guaranteed not > to happen: > > <http://turbogears.org/2.0/docs/main/Wiki20/wiki20.html> > > "TurboGears 2 provides a flexible transaction management system that > automates this process wrapping each web request in its own transaction and > automatically rolling back that transaction if you get a python exception, or > return an HTTP error code as your response." > > Either I misunderstand that; I am somehow starting a second transaction > somewhere; or it doesn't work. > > My code doesn't appear to start any transactions without appropriately > safeguarding their termination. And this seems to be happening no matter what > method I hit on which controller. > > Any suggestions? Off the top of my head: > > - some way of finding at what point in the code it's starting transactions; > or possibly > - some central point where I can check whether I have any transactions open > at the end of my controller methods and close them (a bit blunt, obviously; > but I'll take what I can get at this point) > > When this fails, I get this peculiar backtrace: > > <http://pylonshq.com/tracebacks/71a65e0a1003644339a7ae06384d8538> > > This appears to be a backtrace on the error handling code. No sign of > anything I wrote anywhere in that stack trace. Other than maybe repoze, I > guess?
Nothing that *you* wrote? So far, I haven't see anything called "eagle" in my stacktraces. Including a "eagle.middleware". All I can say is: it works for me, and others. So I'm inclined to say: it's something you do. "repoze.tm" is the responsible middleware for opening/closing transactions. And usually does it's job. But only if the model code properly sets up the session. I suggest you quickstart a new project with authorization enabled (to have some DB-model), add a simple controller method that queries this model, and see if it happens to you there as well. If not, try & see what you do different in setting up your model. Or in your middlewares. Diez -- You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en.

