Skip to content

session.refresh() / load_on_ident() still hardwired to "deprecated" with_lockmode() #3991

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot
Collaborator

Migrated issue, originally created by Michael Bayer (@zzzeek)

we deprecated with_lockmode() in 0.9 but session.refresh() still codes to it. linking refresh() to with_for_update() might be awkward due to the flags, probably have a dictionary passed in using kw argument with_for_update.

however, awkward to say session.refresh(obj, with_for_update={}) and that means FOR UPDATE since empty dict implies boolean false.

Activity

sqlalchemy-bot

sqlalchemy-bot commented on May 15, 2017

@sqlalchemy-bot
CollaboratorAuthor
sqlalchemy-bot

sqlalchemy-bot commented on May 24, 2017

@sqlalchemy-bot
CollaboratorAuthor

Michael Bayer (@zzzeek) wrote:

Add with_for_update() support in session.refresh()

Session.refresh() is still hardcoded to legacy lockmode,
come up with a new API so that the newer argument style
works with it.

Added new argument :paramref:.with_for_update to the
:meth:.Session.refresh method. When the :meth:.Query.with_lockmode
method were deprecated in favor of :meth:.Query.with_for_update,
the :meth:.Session.refresh method was never updated to reflect
the new option.

Change-Id: Ia02a653746b7024699b515451525a88d7a17d63a
Fixes: #3991

de11c52

sqlalchemy-bot

sqlalchemy-bot commented on May 24, 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

          session.refresh() / load_on_ident() still hardwired to "deprecated" with_lockmode() · Issue #3991 · sqlalchemy/sqlalchemy