Hi Diez, On Tue, Jan 27, 2009 at 1:29 PM, Diez B. Roggisch <[email protected]> wrote: > > Sanjiv Singh schrieb: >> Hi, >> >> I am calling external apps (Mapfish) in my controller methods which >> does a DBSession.commit. So I am using postpone_commits decorator to >> let zope transaction handle my commits. It works fine as long as I run >> my app as an independent TG2 app. >> >> Now I want to mount my app under another app like this: >> >> from vectorapp.controllers.root import RootController as VectorAppControler >> >> class RootController(BaseController): >> vectorapp = VectorAppController() >> >> Although the controller methods in vectorapp have a postpone_commit >> decorator. I still get this error. >> http://paste.chrisarndt.de/paste/d09a71eb9cf54390817efc107feea3b2 > > I had a look at that decorator - and it it incomplete, if not broken. To > fix it isn't trivial, so that might be one of the reasons. > > And are you sure that mapfish uses the DBSession TG provides?
You got it right. I was passing a reference to TG's DBSession, but the wrong one when mounting inside another TG2 app. Importing DBSession from the mounting app inside the mounted app solved it. Is there a way other than using postpone_commits decorator to get around zope transaction? Thanks Sanjiv > > Diez > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
