DDC-681: PATCH: UnitOfWork#lock locks by column names instead of field names #839

Open
opened 2026-01-22 12:52:14 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 10, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user dennis.verspuij:

On line 1700 of UnitOfWork#lock column names are used instead of field names, I think the line should read:

array_combine($class->getIdentifierFieldNames(), $this->entityIdentifiers[$oid]),

A related question: when I load an instance by relation, e.g. $author = $book->getAuthor(), I cannot specify a lock type at that point, so I have to call $em->lock($author, LockType::PESSIMISTIC_WRITE) afterwards, which results in two database queries for the same record. Is it possible to do this at once, without setting a transaction isolation level?

Originally created by @doctrinebot on GitHub (Jul 10, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user dennis.verspuij: On line 1700 of UnitOfWork#lock column names are used instead of field names, I think the line should read: ``` array_combine($class->getIdentifierFieldNames(), $this->entityIdentifiers[$oid]), ``` A related question: when I load an instance by relation, e.g. $author = $book->getAuthor(), I cannot specify a lock type at that point, so I have to call $em->lock($author, LockType::PESSIMISTIC_WRITE) afterwards, which results in two database queries for the same record. Is it possible to do this at once, without setting a transaction isolation level?
admin added the Bug label 2026-01-22 12:52:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#839