Closed
Description
Migrated issue, originally created by Michael Bayer (@zzzeek)
The after_commit() handler is called before the snapshot is removed. It's not clear why the after_rollback() handler is called after the snapshot is removed. It is useful for applications to have access to the state of the objects in this event. There's also no test coverage asserting that snapshot is present for after_commit().
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
sqlalchemy-bot commentedon Mar 11, 2017
Michael Bayer (@zzzeek) wrote:
https://gerrit.sqlalchemy.org/334
sqlalchemy-bot commentedon Mar 14, 2017
Michael Bayer (@zzzeek) wrote:
Emit after_rollback() event before snapshot removal
The state of the :class:
.Session
is now present when the:meth:
.SessionEvents.after_rollback
event is emitted, that is, theattribute state of objects prior to their being expired. This is now
consistent with the behavior of the
:meth:
.SessionEvents.after_commit
event which also emits before theattribute state of objects is expired.
Change-Id: I9c572656ec5a9bfaeab817e9c95107c75aca1b51
Fixes: #3934
→ 4ece86e
sqlalchemy-bot commentedon Mar 14, 2017
Changes by Michael Bayer (@zzzeek):