summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-06-09 12:20:07 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-06-09 12:20:07 -0400
commit8f1130672d5a54dee311a11041857abfe85aa8a5 (patch)
tree749011bf4882f689d4ae9c9fec13ee5a03f0f042
parentc9712e4bd50f9a0c028e9b0f2ff994a75346e101 (diff)
downloadsqlalchemy-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.rst7
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