You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a method annotated with grails.plugin.cache.Cacheable.
testgsp.PanelsRefresher
@Cacheable(value="gabiTest") public Integer gabiTest() { log.info("Gabi is testing") return 5 }
Consider an aspect that should be executed when gabiTest method is executed:
This is not fixable since the newer cache plugin does not use Spring AOP/proxying and instead directly modifies the byte code of the target class through an AST transformation, which is better for performance and debugging, but means it cannot run before dynamic Spring AOP aspects
So if i want the behaviour I had before, I have to use the spring annotation, but I won't benefit from the performance enhancements available for grails cache plugin annotations?
Consider a method annotated with grails.plugin.cache.Cacheable.
testgsp.PanelsRefresher
@Cacheable(value="gabiTest") public Integer gabiTest() { log.info("Gabi is testing") return 5 }
Consider an aspect that should be executed when gabiTest method is executed:
`@Aspect
@slf4j
class TestAspect {
The aspect will be executed every time, even if the result is cached.
Sample output when executing PanelsRefresher.gabiTest() multiple times:
2019-01-14 15:20:15.151 INFO --- [ main] testgsp.PanelsRefresher : Gabi is testing 2019-01-14 15:20:15.151 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.152 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.155 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi before. 2019-01-14 15:20:15.156 INFO --- [ main] testgsp.TestAspect : Aspect for gabi after.
This is not reproducible when using the spring Cacheable annotation, together with @EnableCaching annotation on Application.groovy.
I am using grails 3.3.9 with grails cache plugin 4.0.1. In grails 2.5.2, with cache:1.1.8 this works fine.
The text was updated successfully, but these errors were encountered: