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'.
Diez
> --
> You received this message because you are subscribed to the Google
> Groups "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to turbogears+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/turbogears?hl=en
> .
>
I'd like to ask: is this documented somewhere? Because I spent hours looking, and didn't find it…
http://turbogears.org/2.0/docs/main/Wiki20/wiki20.html#initializing-the-tables
and is somewhat described here:
http://turbogears.org/2.1/docs/main/Config/SQLAlchemy.html?highlight=commit
but we should definitely do better.
Heck, I even wonder if the benifit of the transaction manger is less
than the cost of people getting confused because the standard
SQLAlchemy way does not work.
Perhaps we should make it optional at some point. I do think it's a
great feature when you have multiple databases, or when you want to
delay some other actions until you know the commit went in ok.
--Mark Ramm
> --
> You received this message because you are subscribed to the Google Groups "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.
>
>
--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog