Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@CacheEvict used to support an array of cache-names as value which is no longer possible #59

Open
ClemensSchneider opened this issue Feb 15, 2019 · 2 comments

Comments

@ClemensSchneider
Copy link

If an invocation of a method results in multiple caches to be cleared, the following was possible using v1.1.8 of this plugin.

@CacheEvict(value=[StatisticsService.SERVICE_STATISTICS_CACHE, StatisticsService.DETAILED_TRANSFER_STATISTICS_CACHE, StatisticsService.GENERAL_STATISTICS_CACHE], allEntries=true)

Now it's throwing an exception as the cacheNameException is being cast to an ConstantExpression (ConstantExpression cacheNameExpression = (ConstantExpression)ScriptBytecodeAdapter.castToType(annotationNode.getMember("value"), ConstantExpression.class);)

@rodvlopes
Copy link

Were you able to solve this? I am stuck with this very same problem:

@CacheEvict(value = ['ok'], allEntries = true)
def okce() {
  println 'evict called'
}

I'm getting the following error after changing from value = 'ok' to value = ['ok']
General error during semantic analysis: Cannot cast object 'org.codehaus.groovy.ast.expr.ListExpression@7791d570[org.codehaus.groovy.ast.expr.ConstantExpression@29585d0d[ok]]' wi
th class 'org.codehaus.groovy.ast.expr.ListExpression' to class 'org.codehaus.groovy.ast.expr.ConstantExpression'

@ClemensSchneider
Copy link
Author

Blast from the past :)
Sorry, but I can't remember if and how I solved it... Most likey moved to inject the underlying CacheManager and doing the evict myself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants