grails-cache icon indicating copy to clipboard operation
grails-cache copied to clipboard

@Caching is missing

Open miguelabautista opened this issue 8 years ago • 1 comments

Why @Caching is not available?

miguelabautista avatar Jan 09 '17 12:01 miguelabautista

+1

Before, in grails 2, for evicting values from several caches following code has been used

  @Caching(evict = [
      @org.springframework.cache.annotation.CacheEvict(value = "cache1", allEntries = true),
      @org.springframework.cache.annotation.CacheEvict(value = "cache2", key = '"getTopNewList"'),
  ])
  def cleanCache(){}

In Grails 3 the solution don't work anymore
See example project in attched file

How to solve it? duplicate annotation not supported

startup failed: grails-app/services/CacheService.groovy: 54: Cannot specify duplicate annotation on the same member : grails.plugin.cache.CacheEvict @ line 54, column 3. @CacheEvict(value = "myCache", key = '#id') ^

1 error FAILURE: Build failed with an exception.

test-3.1.14.zip

demon101 avatar Jan 25 '17 15:01 demon101