mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Problems with Bulk Updates using Iterator #5492
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ncirocco on GitHub (Apr 3, 2017).
Originally assigned to: @Ocramius on GitHub.
Using the previous code the only entities that are being successfully updated are the ones that the
ifcondition istrueduring their iteration. The ones that were modified butflushwas not called during their iteration are not being updated.Also the remaining ones that should be flushed outside of the while are not being flushed successfully.
based on: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/batch-processing.html#iterating-results
For example:
given the entities with id range 1-12
PHP version: 7.0.17
Doctrine
doctrine/annotations v1.2.7
doctrine/cache v1.4.2
doctrine/collections v1.3.0
doctrine/common v2.5.1
doctrine/data-fixtures v1.1.1
doctrine/dbal v2.4.4
doctrine/doctrine-bundle v1.5.2
doctrine/doctrine-cache-bundle v1.0.1
doctrine/doctrine-fixtures-bundle v2.2.1
doctrine/doctrine-migrations-bundle 1.0.1
doctrine/inflector v1.0.1
doctrine/instantiator 1.0.5
doctrine/lexer v1.0.1
doctrine/migrations dev-master 087f738
doctrine/orm v2.4.8
@Ocramius commented on GitHub (Apr 3, 2017):
$this->em->clear();causes the entities to be cleared, so there's no way to know whether some of those entities were cached inside the hydrator due to fetch-join operations, or whether they were completely detached (that's what you should assert upon)Closing as
invalid