From 5d8bb1f4a65c8932c0dcb39d241b521bd95db681 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 9 Nov 2015 16:48:58 -0500 Subject: [PATCH] - fix ambiguous documentation re: after_flush_postexec(), the looping nature of it only occurs within the context of a commit. --- doc/build/orm/session_events.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/build/orm/session_events.rst b/doc/build/orm/session_events.rst index 50c63e6ea0..ecfc5176f2 100644 --- a/doc/build/orm/session_events.rst +++ b/doc/build/orm/session_events.rst @@ -72,7 +72,10 @@ for finalized objects and possibly emit additional SQL. In this hook, there is the ability to make new changes on objects, which means the :class:`.Session` will again go into a "dirty" state; the mechanics of the :class:`.Session` here will cause it to flush **again** if new changes -are detected in this hook. A counter ensures that an endless loop in this +are detected in this hook if the flush were invoked in the context of +:meth:`.Session.commit`; otherwise, the pending changes will be bundled +as part of the next normal flush. When the hook detects new changes within +a :meth:`.Session.commit`, a counter ensures that an endless loop in this regard is stopped after 100 iterations, in the case that an :meth:`.SessionEvents.after_flush_postexec` hook continually adds new state to be flushed each time it is called. -- 2.47.2