Why @Scheduled annotation doesn't work with @Transaction annotation. Spring Boot
I have a question: Why when we annotate method with @Scheduled and @Transaction , transaction doesn't work? I know that the @Scheduled call my class instead of proxy class that created by Spring, but can't understand this behavior. import org.springframework.scheduling.annotation.Scheduled; import org.springframework.transaction.annotation.Transactional; @Service public class UserServiceImpl implements UserService { @Override @Scheduled(fixedRateString = "${somestring}",initialDelayString = "${anotherstring}") @Transactional public void doSomething() { } } I have two solutions of this problem: