开启事务,发生异常后回滚

@Transactional(rollbackFor = Exception.class)
放在方法上
需要再方法里抛出异常,发生异常后,则回滚

posted @ 2022-06-11 18:03  小幼虫虫  阅读(22)  评论(0)    收藏  举报