Closed GoogleCodeExporter closed 9 years ago
Sorry! @ReadThroughAssignCache is ok.
Original comment by zhaob...@gmail.com
on 21 Sep 2012 at 8:07
Please close it.
Original comment by zhaob...@gmail.com
on 21 Sep 2012 at 8:14
If you don't want to use any of the method's parameters as a part of cache key
then use 'assign' cache. In your case @ReadThroughAssignCache. It will store
data under defined and constant (= assign) cache key.
Keeping list of objects under one key is not best solution when also separated
object (Role) is stored. The drawback is higher memory consumption and complex
update&invalidate process. Each time the object need to be updated all its
copies in cache have to be updated otherwise cache become inconsistent.
The solution to this problem that I use is to keep each object in cache only
once and refer to it using object id.
In you case each Role should be store under different cache key (using roleId)
and instead of keeping list of all Roles store list of all Roles' ids. Using
the ids you can fetch all Roles.
Original comment by ragno...@gmail.com
on 21 Sep 2012 at 8:37
Original issue reported on code.google.com by
zhaob...@gmail.com
on 21 Sep 2012 at 7:11