As the doctor says: if it hurts, don't do it. In this case, don't commit. A middleware will do that for you. If you need an id (sa is lazy), flush.

Diez

Am 02.07.2010 um 20:42 schrieb Guyren G Howe <[email protected]>:

I'm doing this:

maker = sessionmaker(autoflush=True, autocommit=False, extension=ZopeTrnsactionExtension())
DBSession = scoped_session(maker)
user = User(…)
DBSession.add(user)
DBSession.commit

At this point, I get a "Transaction must be committed using the transaction manager" exception. Can anyone suggest why?

FWIW, datamanager is throwing the exception because zope_transaction.get().status is 'Active' rather than 'Committing'.

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


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