From 8f1130672d5a54dee311a11041857abfe85aa8a5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 9 Jun 2015 12:20:07 -0400 Subject: [PATCH] - add a comment, also I think we want to expire before we do the new begin, as begin_nested() does a flush --- doc/build/orm/session_transaction.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.47.3