I'm using Ehcache implementation of JCache.
Lets say, I've class Test
. In this class I've two methods: methodA
and methodB
. methodB
has annotation @CacheResult(cacheName = "methodB")
.
From this informations you would guess that I'd like to have cached method methodB
and methodA
should use this cache.
But... It does not work. When I'm using methods from the same class, it seems like this annotation is not firing its interceptor. It works though if I create class Test2
and move method methodB
to this class - then, as expected, the result of this method is cached.
How can I enable caching methods from the same class?