anderbubble wrote:
> By default, TurboGears wraps exposed controller methods in a
> transaction that gets committed after the controller has run. This
> commit can generate exceptions (most notably when the condition of
> mapped objects violates an integrity constraint in the database). How
> can I catch/handle these exceptions without turning off the automatic
> transaction handling?

As of TG 1.0.2+ you can now get access to the SA transaction via 
cherrypy.request.sa_transaction. You can also replace it with a new one 
and TG will then commit that after the controller returns.

So after doing your own commit/rollback/flush/whatever-you-feel-like 
just make sure you leave another valid transaction there for TG to 
commit on the way out. Probably still not the cleanest way to handle 
this but it should work.

Janzert

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to