PLEASE IGNORE PREVIOUS.

It turns out that explicitly flushing does change the order (made a
silly coding error before).

I am all set, but the question remains why autoflush isn't enough.

On May 23, 2:15 pm, "Moshe C." <[EMAIL PROTECTED]> wrote:
> I have a mapper created with a mapper extension that has an
> after_update() override.
> For a table in the mapper I do an update and then a commit().
>
> This is the resulting order of execution:
>
> update instance (setting an attribute on the mapped class)
> commit
> after_update called on instance
>
> I.e. The after_update is called after the commit (after the commit has
> actually committed to the DB , in fact).
> How can I cause it to be called before the commit?
> I have tried flushing explicitly before committing (although the
> session is autoflush) but it didn't change the behavior. Trying to use
> before_update instead, didn't change things either.
>
> Why the order is important : In the after_update I save to another
> table of the session. I would like the commit() call to commit the
> whole transaction - both the original update and the insertion in the
> aftre_update().
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to