mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[BUG] One to one relation breaks cache entities relations #5271
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 @BourotBenjamin on GitHub (Sep 23, 2016).
I have an entity like :
I tried to investigate why the cache returns users with actualLanguage = null ( because every user hav an actual Language )
I found that in
Doctrine\ORM\Cache\DefaultQueryCache, the functiongetdoesn't seems to resolve my Users linked entities right.As my users have a One to One relation, I found in
$rsm->relationMap, I have the User to Infos relation.So, my user
$hasRelationis true so it doesn'tresolveAssociationEntries.My user doesn't have any
$entry['associations']neither so it don'tresolveAssociationEntriesafter.I don't know whats wrong here.
I don't know if I don't have any associations because I didn't requested any entities in EAGER mode and if it's normal.
Maybe the enities needs to resolveAssociationEntries each time.
Why don't you resolve them if you have oneToOne associations ?
The only thing I know is that my entities aren't complete when I get them back from cache.
Thanks in advance
@phoenixgao commented on GitHub (Dec 26, 2017):
I have exactly the same issue @BourotBenjamin did you figure out why?
@Ocramius commented on GitHub (Dec 26, 2017):
Is this still valid for 2.6.0?
On 26 Dec 2017 11:22, "Phoenix Gao" notifications@github.com wrote:
@phoenixgao commented on GitHub (Dec 26, 2017):
@Ocramius Currently I'm using doctrine/orm 2.5.13, will try 2.6
@vincequeiroz commented on GitHub (Jan 22, 2018):
I have the same issue too, but I'm use class table inheritance with second level cache.
@Ocramius I'm rollback to version 2.5.14 and it works.
@Ocramius commented on GitHub (Jan 26, 2018):
@vincequeiroz your scenario is probably different, since @phoenixgao experiences this issue on
2.5.x