diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-06-09 12:20:07 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-06-09 12:20:07 -0400 |
commit | 8f1130672d5a54dee311a11041857abfe85aa8a5 (patch) | |
tree | 749011bf4882f689d4ae9c9fec13ee5a03f0f042 | |
parent | c9712e4bd50f9a0c028e9b0f2ff994a75346e101 (diff) | |
download | sqlalchemy-8f1130672d5a54dee311a11041857abfe85aa8a5.tar.gz |
- add a comment, also I think we want to expire before we do the
new begin, as begin_nested() does a flush
-rw-r--r-- | doc/build/orm/session_transaction.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/build/orm/session_transaction.rst b/doc/build/orm/session_transaction.rst index 08f11afcc..bca3e944f 100644 --- a/doc/build/orm/session_transaction.rst +++ b/doc/build/orm/session_transaction.rst @@ -504,7 +504,12 @@ everything is rolled back. @event.listens_for(self.session, "after_transaction_end") def restart_savepoint(session, transaction): if transaction.nested and not transaction._parent.nested: - session.begin_nested() + + # ensure that state is expired the way + # session.commit() at the top level normally does + # (optional step) session.expire_all() + session.begin_nested() + # ... the tearDown() method stays the same |