the nested transaction / savepoint syntax in sqlalchemy appears to be:

> session = SessionFactory()
> session.begin()                 # main tx
> session.begin_nested()     # outer tx
> session.begin_nested()     # inner tx
> session.rollback()             # innter tx
> session.commit()             # outer tx
> session.commit()             # main tx

that's really confusing.  

thinking of how transactions are supported in postgres , zope/transaction , 
twisted, and a few other things, I'm left wondering why this pattern was 
chosen.

is there any reason why you didn't pursue something like :

* `session.rollback` and `session.commit` always refer to the 'main' 
transaction ; `nested_commit()` + `nested_rollback()` are available 

* `session.begin_nested()` returns the unique savepoint id ; passing in 
that argument to commit/rollback [ `.commit(savepoint)` 
`.rollback(savepoint)` ] would then release / rollback .  




-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to