I have a project that uses spring boot1.5+spring data jpa. If the method is called in @Scheduled, javax.persistence.TransactionRequiredException: Executing an update/delete query will be generated. If it is called in the controller, it is normal. My service method uses @Transaction annotation
What happened
Comment From: snicoll
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.
Comment From: romantictravel01
I think it's a magic problem, come and save me
task
service
dao
error
If I add a controller and call it in the controller, the method executes normally
@RestMapping...
@ResponseBody
public String test(){
generateTaskService.updateStatus(1,2);
}
Give me some advice
Comment From: wilkinsona
@romantictravel01 This isn't the right place to ask for advice. Please use Gitter or Stack Overflow for that. Also, please be aware that Spring Boot 1.5 is no longer support. You should be looking to upgrade to 2.x as soon as you can.