From: Mike Bayer Date: Tue, 9 Jun 2015 16:20:07 +0000 (-0400) Subject: - add a comment, also I think we want to expire before we do the X-Git-Tag: rel_1_0_6~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f1130672d5a54dee311a11041857abfe85aa8a5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - add a comment, also I think we want to expire before we do the new begin, as begin_nested() does a flush --- diff --git a/doc/build/orm/session_transaction.rst b/doc/build/orm/session_transaction.rst index 08f11afccb..bca3e944fe 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