Re: [sqlalchemy] Re: A "after flush before commit" event

2017-09-20 Thread vineet
Hey Mike, Thanks for taking the time to answer all of these questions! I think what we're looking for is a way to perform some actions immediately before "COMMIT" is sent to the database. The current solutions (as far as I can understand them) all have some drawbacks: *Perform actions in

Re: [sqlalchemy] Re: A "after flush before commit" event

2017-09-19 Thread Mike Bayer
On Tue, Sep 19, 2017 at 4:06 PM, wrote: > 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 >

Re: [sqlalchemy] Re: A "after flush before commit" event

2017-09-19 Thread mike
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

Re: [sqlalchemy] Re: A "after flush before commit" event

2017-09-19 Thread Mike Bayer
On Tue, Sep 19, 2017 at 12:19 AM, 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

[sqlalchemy] Re: A "after flush before commit" event

2017-09-18 Thread mike
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? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

[sqlalchemy] Re: A "after flush before commit" event

2017-09-14 Thread Jonathan Vanasco
Is there a reason why you can't `flush` as the first action the `before_commit` event ? -- 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