解决springboot整合mybatis-plus中使用批量接口事务无法回滚的问题
在实际开发中,难免会使用springboot整合mybatis-plus,在一个方法中使用中至少包含一个批量操作时,方法注解又是非Exception时,会出现回滚异常。
根本原因:springboot在整合mybatis-plus时,业务层会继承ServiceImpl<M extends BaseMapper, T> 类,在这个类中,批量接口会使用注解管理,如下图
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f673f9e581522f9396314c7807fc1a93.png)
解决方案:
1.自己实现批量接口
2.统一接口异常