Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the lock mode in the "Aggregate Fields" cookbook (aggregate-fields.rst) article. #11344

Open
wants to merge 1 commit into
base: 3.1.x
Choose a base branch
from

Conversation

d-ph
Copy link

@d-ph d-ph commented Mar 8, 2024

Change PESSIMISTIC_READ to PESSIMISTIC_WRITE because otherwise the solution to the race condition at the bottom of the article would allow concurrent reads, which would not solve the presented race condition problem.

Please correct me if I'm wrong because I might be.

Change `PESSIMISTIC_READ` to `PESSIMISTIC_WRITE`. Otherwise, the solution to the race condition at the bottom of the article would allow concurrent reads, which would not solve the presented race condition problem.
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks consistent with https://www.doctrine-project.org/projects/doctrine-orm/en/3.1/reference/transactions-and-concurrency.html#pessimistic-locking, which mentions that write acts at the database level. It's not completely clear at what level read acts. I'd check the implementation if I wasn't on my phone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants