Skip to content

call after_rollback() before accounting state is reset? #3934

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot
Collaborator

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().

Activity

sqlalchemy-bot

sqlalchemy-bot commented on Mar 11, 2017

@sqlalchemy-bot
CollaboratorAuthor
sqlalchemy-bot

sqlalchemy-bot commented on Mar 14, 2017

@sqlalchemy-bot
CollaboratorAuthor

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, the
attribute 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 the
attribute state of objects is expired.

Change-Id: I9c572656ec5a9bfaeab817e9c95107c75aca1b51
Fixes: #3934

4ece86e

sqlalchemy-bot

sqlalchemy-bot commented on Mar 14, 2017

@sqlalchemy-bot
CollaboratorAuthor

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
added this to the 1.2 milestone on Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingorm

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sqlalchemy-bot

        Issue actions

          call after_rollback() before accounting state is reset? · Issue #3934 · sqlalchemy/sqlalchemy