Just checking, but one scenario where "after flush before commit" would not 
work is when all changes are flushed immediately before a commit, right?
In that case, "commit" would not automatically be preceded by a "flush" 
(and the "after_flush_postexec" code would not run because no token from 
"before_commit" has been set).

e.g.,
# make some changes
session.flush()
session.commit()  # Does not kick off its own flush

On Tuesday, September 19, 2017 at 6:27:12 AM UTC-7, Mike Bayer wrote:
>
> On Tue, Sep 19, 2017 at 12:19 AM,  <[email protected] <javascript:>> 
> wrote: 
> > Followup question -- this the following order of events guaranteed? 
> > 
> > before_commit --> after_flush --> after_flush_post_exec 
> > 
> > i.e., is an after_flush_post_exec guaranteed to run after the 
> before_commit 
> > preceding a commit? 
>
> if the flush didn't raise then yes. 
>
>
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper 
> > 
> > http://www.sqlalchemy.org/ 
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> > description. 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sqlalchemy" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at https://groups.google.com/group/sqlalchemy. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to