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

2017-09-19 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 befor

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 > the "after_flush_postex

Re: [sqlalchemy] Deferred column getting unintentionally deferred

2017-09-19 Thread Mike Bayer
On Tue, Sep 19, 2017 at 1:16 PM, Neena Parikh wrote: > Hi there, > > After implementing the solutions for raising on column usages brought up at > https://groups.google.com/forum/#!topic/sqlalchemy/Lbyq8Co95mQ, I've come > across an issue where a deferred column is being loaded by default after a

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 "b

[sqlalchemy] Deferred column getting unintentionally deferred

2017-09-19 Thread Neena Parikh
Hi there, After implementing the solutions for raising on column usages brought up at https://groups.google.com/forum/#!topic/sqlalchemy/Lbyq8Co95mQ, I've come across an issue where a deferred column is being loaded by default after a series of function calls. Here's the minimal repro I could f

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 the flush didn't rai

Re: [sqlalchemy] after_commit and failure

2017-09-19 Thread Felix Ruiz de Arcaute
thx On Mon, Sep 18, 2017 at 5:39 PM, Mike Bayer wrote: > On Mon, Sep 18, 2017 at 10:41 AM, cecemel > wrote: > > Hi, > > > > will the after_commit event get fired if the commit failed? > > > > Don't see anything in the doc about that. > > > it wont. > > > > > > thx > > > > -- > > SQLAlchemy - >