@CacheEvict not working when there's @Cacheable in the same class?
Hello,
I have two methods in my class like this:
Code:
@Cacheable("mycache")
@Transactional(readOnly = true)
public SearchResultDTO<PromotionDTO> getPromotions(int startIndex, int pageSize, ....){
.....
}
@CacheEvict(value = "mycache", allEntries = true)
@Transactional(readOnly = false)
public void deletePromotion(String applicationId, Long promotionId) {
.....
}
When I start the app, the SpringCacheAnnotationParser parser is never called to process the CacheEvict annotation (method: public Collection<CacheOperation> parseCacheAnnotations(AnnotatedElement ae) )
If I change my code and remove the Cacheable annotation, the parser processes the CacheEvict annotation properly.
Is this a bug or a framework restriction?
Regards,
Juan