mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #5578] Resolve associations cache key not part of ResultSetMapping #9651
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?
Original Pull Request: https://github.com/doctrine/orm/pull/5578
State: closed
Merged: No
Yet another bug with 2nd level cache :) I cannot generate a proper test case (for now), so I try to explain the issue to sum up my change. This happens in
2.5,2.5-devanddev-masterbranches.the bug
I set up a DQL query which use
setCachable(true), and (almost) everything is configured to use 2nd level cache. While retrieving object from cache through theDefaultQueryCache, I got the following error:The error is triggered by an
AssociationCacheEntrywhich is left behind during entity hydration.why it happen
I saw that in
DefaultQueryCachethe normal association cache resolution is overriden byResultSetMappingresolution. This probably make sense, but the entity hydration is inlined (with a bigTODO:) insideDefaultQueryCache, instead of usingDefaultEntityHydrator.I think that resolving only
Rsmmapping is not enough. If the entity is cached throughDefaultEntityHydrator::buildCacheEntry, there are also other association.my fix
I cannot provide a proper solution for merging the Rsm logic into
DefaultEntityHydrator, to get rid of the TODO. So I copied the relevant part toDefaultQueryCache, just to fix the issue for now.