8000 Implement FOR UPDATE SKIP LOCKED · Issue #7746 · doctrine/orm · GitHub
[go: up one dir, main page]

Skip to content
Implement FOR UPDATE SKIP LOCKED #7746
@BenMorel

Description

@BenMorel

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

As far as I can see, there is currently no way to perform a SELECT FOR UPDATE SKIP LOCKED (MySQL, PostgreSQL) with Doctrine.

This is really useful, for example when lauching several concurrent workers picking jobs from a single table, as it effectively prevents two workers from getting the same job, and automatically and immediately makes the job available again in case the transaction is aborted.

Would you be willing to add this feature? This could be implemented this way:

$em->find($id, LockMode::PESSIMISTIC_WRITE | LockMode::SKIP_LOCKED);

I can open a PR if you agree with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0