1. https://jingyan.baidu.com/article/3a2f7c2e27d51b26afd611ff.html

 

2. https://blog.csdn.net/lee_star1/article/details/71730107

 

需抛出RuntimeException错误

throw new RuntimeException("回滚");
try {
    //业务逻辑
} catch (Exception e) {
    task = false;
    e.printStackTrace();
    throw new RuntimeException("数据插入失败,回滚");
}    

 

posted on 2018-07-11 10:41  木风向前冲  阅读(1254)  评论(0编辑  收藏  举报