On May 31, 2010, at 10:28 AM, Kent Bower wrote: >> that's how the engine-level API works - you get at a Transaction object that >> you can roll back anywhere in the chain (its up to you to know that the >> other Transaction objects in the middle are no longer valid). In the ORM >> we wanted to keep things more simplistic. I would note that begin() and >> begin_nested() do return the SessionTransaction object though, which does >> itself include commit() and rollback() methods. You might want to try the >> above pattern with it, as it might accomplish this already ( I didn't write >> the SessionTransaction accounting logic). >> >> > Ok, good news, that is already taken care of properly, as you suspected. > Both the database rollback to the correct savepoint is issued and also the > session data contains the correct data from before sp_a. > > This statement in the docs is what lead me to believe this is not implemented: > "For each begin_nested() call, a corresponding rollback() or commit() must be > issued." (http://www.sqlalchemy.org/docs/session.html) > That is misleading, I guess, maybe there is a better way to state that > requirement? (I didn't need to issue a rollback or commit() for each > begin_nested(), I am allowed to skip back to a previous one, very nice!)
See, I didn't know that it actually worked, we don't have any coverage for that. I'd rather get some coverage in orm/test_transaction.py before I start advertising that functionality. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.