When using Transaction the rollback is emitted implicitly either by Transaction or by zope.sqlalchemy, and manually calling savepoint.rollback() after a failure results with InvalidSavepointRollbackError. At least that was the case when I tried that, please see earlier posts in this topic.


Thanks!

.oO V Oo.


On 11/14/2011 09:27 PM, Chris McDonough wrote:
On Mon, 2011-11-14 at 21:14 +0100, Vlad K. wrote:
Because each savepoint must be met by one commit or one rollback. If I
use session.flush(), the second call would start savepoint 2, but would
not release savepoint 1 (nor roll it back). While that may work "fine"
for this case, I am not sure I want that in the real app where situation
is much more complex.


http://www.sqlalchemy.org/docs/orm/session.html#using-savepoint


Also, this answers my other problem I posted a few days ago about using
database-based process "locks" with select ... for update. I need
multiple commits within single request.
I'll defer to you on this, but I'll note that the "savepoint" object you
get back from calling transaction.savepoint() has a "rollback" method
FWIW.

- C

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to