mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
The old collection not deleted after a sequence of two flushes #5771
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 @vtsykun on GitHub (Nov 19, 2017).
Originally assigned to: @Majkl578 on GitHub.
When you in full rewrite a collection for an entity, sometimes an old collection is not removed from the database.
Example
Origin entity
After the first flush, the changes for the collection fields are no longer tracked and an error occurred during the second flush.
If you remove the first flush then it works fine.
@Majkl578 commented on GitHub (Dec 16, 2017):
This is by design as it is now, changing collection itself is not supported and must be kept as PersistentCollection assigned by UnitOfWork.