[PR #5579] Fix performance issue when using notify tracking policy and calling flush($entity) multiple times #9654

Closed
opened 2026-01-22 16:04:59 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/5579

State: closed
Merged: No


Hi,

First of all I want to apologize for the poor quality of my English.

We had some performance issues in one of our project and we decide to use the Notify tracking policy.
This tracking policy is really usefull for batch and import. For your information we improved the performance of more than 80%.

During our test we discover that flush operations were cleaning the $entityChangeset of the UnitOfWork.
This is a real issue for us because we are using flush with null and entity as parameter.
Example:

$object1->setData($data);
$object2->setData($data);
$this->entityManager->flush($object1);
$this->entityManager->flush($object2);

With the notify tracking policy this code above will only save the change of the object1. All the other changes are lost.

**Original Pull Request:** https://github.com/doctrine/orm/pull/5579 **State:** closed **Merged:** No --- Hi, First of all I want to apologize for the poor quality of my English. We had some performance issues in one of our project and we decide to use the Notify tracking policy. This tracking policy is really usefull for batch and import. For your information we improved the performance of more than 80%. During our test we discover that flush operations were cleaning the $entityChangeset of the UnitOfWork. This is a real issue for us because we are using flush with null and entity as parameter. Example: ``` php $object1->setData($data); $object2->setData($data); $this->entityManager->flush($object1); $this->entityManager->flush($object2); ``` With the notify tracking policy this code above will only save the change of the object1. All the other changes are lost.
admin added the pull-request label 2026-01-22 16:04:59 +01:00
admin closed this issue 2026-01-22 16:05:00 +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#9654