I have to integrate spring and ehcache, and trying to implement it with blockingCache pattern
<ehcache:annotation-driven/>
there is one option for self-populating-cache-scope for shared (default) and method. could you please explain what is the difference?
There is also the annotation @Cacheable with selfPopulating flag
As per what I read on some post
it says when shared is used only one instance is created and the same is used everytime the same cache name is used so if I use the selfPopulating flag as true for one method,
all the threads trying to access other methods annotated with @Cacheable with selfPopulating flag set to true will go on hold which I dont want
<ehcache:annotation-driven/>
when self-populating-cache-scope = method on other hand creates separate instances for all methods annotated with @Cacheable with selfPopulating flag set to true so it doesn't create a problem.
But in this case when I try to remove a element using @TriggerRemove and giving the cache name used in @Cacheable will it search in each of those separate instances to find the value? Isnt this an overhead?