springboot 手动触发事务回滚

在springboot中,使用事务回滚:在Controller里面给本身须要回滚方法上加上@Transactional注解。spring 1:手动抛出一个异常: throw new RuntimeException();springboot 2: 经过方法回滚:TransactionAspectSupport.currentTransactionStatus().setRollbackOnly()
相关文章
相关标签/搜索