Results 1 to 3 of 3

Thread: @CacheEvict not working when there's @Cacheable in the same class?

Threaded View

  1. #1

    Default @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
    Last edited by juanmanuel32; Jul 15th, 2012 at 01:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •