当前位置:   article > 正文

Caused by: javax.transaction.RollbackException: Transaction set to rollback only

transaction set to rollback only

事务回滚异常

异常:

JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException .......
Caused by: javax.transaction.RollbackException: Transaction set to rollback only
  • 1
  • 2

进行手动回滚导致异常
原因:

一个service调用了另外一个service,嵌套事务,service中都加了事务@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)

解决:
在大事务调用service的方法上加了@Transactional(propagation = Propagation.SUPPORTS),成功解决

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/346956
推荐阅读
  

闽ICP备14008679号