DDC-1787: Fix for JoinedSubclassPersister, multiple inserts with versioning throws an optimistic locking exception #2252

Closed
opened 2026-01-22 13:46:11 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 18, 2012).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user jack@actinum.nl:

Attached is a small patch for a bug in the file JoinedSubclassPersister.php. When persisting multiple new entities that are subclasses of a baseclass (joined), and having the @Version attribute set, only for the last one a query is run to fetch the new value of the version field. The other one is tested with NULL, and throws an optimistic locking exception.

Originally created by @doctrinebot on GitHub (Apr 18, 2012). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user jack@actinum.nl: Attached is a small patch for a bug in the file JoinedSubclassPersister.php. When persisting multiple new entities that are subclasses of a baseclass (joined), and having the @Version attribute set, only for the last one a query is run to fetch the new value of the version field. The other one is tested with NULL, and throws an optimistic locking exception.
admin added the Improvement label 2026-01-22 13:46:11 +01:00
admin closed this issue 2026-01-22 13:46:12 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 14, 2013):

Comment created by @ocramius:

Merged: https://github.com/doctrine/doctrine2/commit/6f1642b35d56f0609d27a3ff874c456827e90d6b

@doctrinebot commented on GitHub (Dec 14, 2013): Comment created by @ocramius: Merged: https://github.com/doctrine/doctrine2/commit/6f1642b35d56f0609d27a3ff874c456827e90d6b
Author
Owner

@doctrinebot commented on GitHub (Dec 14, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 14, 2013): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/0f26d32249023081b554

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/0f26d32249023081b554 - [11185_JoinedSubclassPersister.php.patch](https://gist.github.com/0f26d32249023081b554#file-11185_JoinedSubclassPersister-php-patch)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2252