-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[2.6] Fix for #7068: EntityManager::find() with pessimistic lock should check for transaction #7291
Conversation
…ould check for transaction
* @throws OptimisticLockException | ||
* @throws TransactionRequiredException | ||
*/ | ||
private function checkLockRequirements(int $lockMode, ClassMetadata $class): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we use a space between )
and :
. Not important though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, leftover from original PR.
Thanks @Majkl578! |
Why the intentional fallthrough here? It causes a BC break when using optimistic locking outside of a tx. I'm probably missing something, but it just bit me. |
I think you are right, the transaction shouldn't be required for an optimistic lock (documentation examples agree), at least not in 2.x. Do you want to submit a PR? 👍 |
My pleasure: #7367 |
Rebased and adjusted #7075 for 2.6.
Fixes #7068.