DDC-3052: [GH-989] Fix the problem when the lifecycle event can be triggered more then once... #3788

Closed
opened 2026-01-22 14:28:02 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 26, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of dyangrev:

Url: https://github.com/doctrine/doctrine2/pull/989

Message:

We recently saw the postUpdate event get trigger multiple time incorrectly, it typically happens when flushing a set of entities persisted whose listener persist and flush another type of entity in it.

Php passes variables to foreach by value, for the function executeUpdates in the UnitOfWork, for example, entities in the $this->entityUpdates could be updated and unset in the listener of the first entity, while them will be updated and trigger listeners again when the process of first entity finishes (although they have already been unset from $this->entityUpdates). Similar for executeInsertion and executeDeletion.

Originally created by @doctrinebot on GitHub (Mar 26, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of dyangrev: Url: https://github.com/doctrine/doctrine2/pull/989 Message: We recently saw the postUpdate event get trigger multiple time incorrectly, it typically happens when flushing a set of entities persisted whose listener persist and flush another type of entity in it. Php passes variables to foreach by value, for the function executeUpdates in the UnitOfWork, for example, entities in the $this->entityUpdates could be updated and unset in the listener of the first entity, while them will be updated and trigger listeners again when the process of first entity finishes (although they have already been unset from $this->entityUpdates). Similar for executeInsertion and executeDeletion.
admin added the Bug label 2026-01-22 14:28:02 +01:00
admin closed this issue 2026-01-22 14:28:03 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 14, 2014):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-989] was closed:
https://github.com/doctrine/doctrine2/pull/989

@doctrinebot commented on GitHub (Jul 14, 2014): Comment created by @doctrinebot: A related Github Pull-Request [GH-989] was closed: https://github.com/doctrine/doctrine2/pull/989
Author
Owner

@doctrinebot commented on GitHub (Jul 14, 2014):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jul 14, 2014): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3788