I'm using the TurboGears framework, utilizing zope with sqlalchemy.
When using SAVEPOINT functionality, the sqlalchemy docs state "For
each begin_nested() call, a corresponding rollback() or commit() must
be issued."
I've checked with Mike Bayer, and the idea is this:
session().begin_nested()
try:
session.add(obj)
session.flush()
session.commit() <---------- problem
except:
session.rollback()
...
the session.commit() inside the nested transaction apparently does not
really issue a database commit. Rather "commit() releases the
savepoint, if thats whats going on contextually. It doesnt actually
commit the outer transaction if you've last called begin_nested(). "
The problem is that zope is forbidding me from calling
session.commit(). I get this:
"""AssertionError: Transaction must be committed using the transaction
manager."""
How is this meant to work? I need to free the savepoint in the event
the flush was successful.
Thanks in advance.
--
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.