mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
SecondCacheLevel association and inheritance update problem #5108
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 @mpoiriert on GitHub (Apr 19, 2016).
Originally assigned to: @lcobucci on GitHub.
I have a entities like this (I just document the minimum needed):
When changing the ChildClass->associations value and persisting it the data in the cache is not removed.
Investigating I found that the Doctrine\ORM\Cache\Persister\Entity\AbstractEntityPersister is using the entityName (that will be ChildClass) but that the Doctrine\ORM\Cache\Persister\Collection\NonStrictReadWriteCachedCollectionPersister is using the $this->sourceEntity->rootEntityName (that will be BaseClass) So it doesn't clear the proper key entry.
Pretty easy to change but might be risky...
If you consider that I am on the good track I can give it a try to make the unit test for it.
@Metabor commented on GitHub (May 9, 2016):
Looks for me similar to the problem reported here:
https://github.com/doctrine/doctrine2/issues/5562
@mpoiriert commented on GitHub (May 9, 2016):
Yes i think the the problem is the same thing since both is related to inheritance and second level cache.
@duytbp commented on GitHub (Sep 27, 2016):
Hi all, is there any update on this bug?
@lcobucci commented on GitHub (Sep 27, 2016):
I believe that #6028 fixes this.
@mpoiriert commented on GitHub (Sep 27, 2016):
No it doesn't
@lcobucci commented on GitHub (Sep 27, 2016):
@mpoiriert weird, what kind of associations do you have? I can investigate this today.
@mpoiriert commented on GitHub (Nov 1, 2016):
Sorry for the delay really busy at the time.
This is the class override I have to fix the issue on my side
and
As you can see the only thing I had to change is to use
$this->sourceEntity->nameinstead of
$this->sourceEntity->rootEntityNameI never did a pull request with that fix since I didn't have time to follow protocol and I did want to make sure it's working. We are using this fix since the 20th April
@lcobucci commented on GitHub (Jan 19, 2017):
@mpoiriert did you try your mapping with
2.6.x-dev?The persisters must use the
rootEntityNameso your fix might break something else we build.You could also send us the mapping you have so we can try it out and find the problem.
@lcobucci commented on GitHub (Jan 19, 2017):
@mpoiriert sorry, you were right that the problem wasn't solved.
I'm sending a PR today that fixes it for good 😉
@mpoiriert commented on GitHub (Jan 19, 2017):
Great thanks. We are planning to upgrade all our stack in the next couples of months so I'll be glad to remove all my factory/override when I'll pass to 2.6.0
@lcobucci commented on GitHub (Jan 19, 2017):
@mpoiriert nice, I'll close this issue since we merged #6244.
Would be amazing if you could test your mapping using
2.6.x-devand report us any other issue.