mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Second level cache does not support scalar results. #5644
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 @lcp0578 on GitHub (Aug 16, 2017).
Originally assigned to: @lcobucci on GitHub.
What's wrong ?
thanks
@lcobucci commented on GitHub (Aug 16, 2017):
@lcp0578 L2C is for entities and associations, not scalar results. If you want that you should use result set cache.
The problem you're having is that
d.id, d.name, d.code, d.parentIdwill not give an object but rather the data, if you want objects you should take a look at partial objects (but your cached data will probably not be complete).I'd suggest you to just load the object instead or relying on result set cache instead of L2C.
@lcp0578 commented on GitHub (Aug 17, 2017):
@lcobucci thanks, i got it.
@simPod commented on GitHub (Aug 5, 2018):
@lcp0578 would you please share how do you use result set cache? I don't want to use partial objects either.
@lcp0578 commented on GitHub (Aug 6, 2018):
@simPod I don't use second level cache,it it for associations.There is my note, hope help you.
https://github.com/lcp0578/cheat-sheets/blob/master/src/symfony/Doctrine/DoctrineCache.md
@simPod commented on GitHub (Aug 6, 2018):
@lcp0578 Thx, pointed me the right direction
A bit weird tho, eg. getting cache implementation from configuration and then injecting it back via
setHydrationCacheProfilesomehow doesn't feel right.