Description
Mitchell Bosecke opened SPR-13914 and commented
I have several methods annotated with @scheduled
and the majority of them run just fine but one of them in particular is not invoked via a proxy, it is invoked directly. The method is on a class annotated with @Service
and @Transactional
and that class has an appropriate interface with the method signature on it; i.e. I'm using JDK dynamic proxies.
The @scheduled
annotation is on the implementation of the method. There is nothing unique about this method compared to my other @scheduled
methods as far as I can tell.
That exact same method, when invoked via a web endpoint works as expected (via proxy and a transaction is available).
I've included some example code in the linked stack overflow post; let me know if I should copy some of that here.
Affects: 3.2.16
Reference URL: http://stackoverflow.com/questions/35184189/spring-scheduled-method-not-invoked-via-proxy-therefore-no-transaction
Issue Links:
- EnableAsync prevents EnableCaching from working in self-injection scenarios [SPR-15915] #20469 EnableAsync prevents EnableCaching from working in self-injection scenarios
- Consistent validation of annotated methods behind AOP proxies [SPR-13816] #18389 Consistent validation of annotated methods behind AOP proxies
- @EventListener does not work if put it at method in class that implements interface [SPR-13650] #18226
@EventListener
does not work if put it at method in class that implements interface