Re: [sqlalchemy] session.transaction / session.begin and always rolling back

2015-03-02 Thread Michael Bayer
Jonathon Nelson jdnel...@dyn.com wrote: For a variety of reasons, sometimes it's nice to be able to do something like this: with dbsess.begin(rollback=True): do_stuff Where the expected behavior is that everything in the context runs in a transaction, but upon exiting the context

[sqlalchemy] session.transaction / session.begin and always rolling back

2015-03-02 Thread Jonathon Nelson
For a variety of reasons, sometimes it's nice to be able to do something like this: with dbsess.begin(rollback=True): do_stuff Where the expected behavior is that everything in the context runs in a transaction, but upon exiting the context we issue a rollback. Sometimes this is useful to