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

Closure for creating key has an issue when used with @Transactional annotation #68

Open
jacobmarcus opened this issue Nov 3, 2019 · 0 comments

Comments

@jacobmarcus
Copy link

This issue is related to #49.

grails -v
Grails Version: 3.3.7
Groovy Version: 2.4.15
JVM Version: 1.8.0_222

The following service method will give the stacktrace below. Issue is with how the key is formed.
It works without the @transactional annotation. Version of cache plugin is 4.0.3.

    @Transactional(readOnly=true)
    @Cacheable(value='codes', key={code + '' + layer})
    def getCachedData(String code, String layer){
      return 'some code'
    }

Caused by: java.lang.NoSuchMethodError: java.lang.String.plus(Ljava/lang/CharSequence;)Ljava/lang/String;
at helloworld.SimpleService$__tt__getCachedData_closure4.doCall(SimpleService.groovy:89)
at grails.plugin.cache.CustomCacheKeyGenerator.generate(CustomCacheKeyGenerator.groovy:115)
at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)

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

1 participant