Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Serialize ClassMetadata::$associationMappings correctly #806
Prior to this commit, APC cached ClassMetadata was completely broken. ClassMetadata::__sleep()
When it is read from the cache it is simply an empty array. In certain cases this can cause
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
When you have APC metadata caching enabled and use merge() on a detached entity, UnitOfWork::doMerge() checks for associationMappings. If no associationMapping is found the originalDocumentData is not updated, leaving it with a old value.
During flush(), for each entity property, the old value is compared to the current one. In this case they are not the same. If the field has an EmbedMany mapping and contains an instance of PersistentCollection, it schedules the field for deletion (
Long story short: Data loss.