摘要:
1. myBatis单独使用时,使用SqlSession来处理事务:
Java代码 收藏代码
public class MyBatisTxTest {
private static SqlSessionFactory sqlSessionFactory;
private static Reader reader;
@BeforeClass 阅读全文
posted @ 2016-10-12 23:25
上校
阅读(1046)
评论(0)
推荐(0)
摘要:
在spring的配置文件中,如果数据源的defaultAutoCommit设置为True了,那么方法中如果自己捕获了异常,事务是不会回滚的,如果没有自己捕获异常则事务会回滚,如下例
比如配置文件里有这么条记录:
[html] view plain copy
print?
阅读全文
posted @ 2016-10-12 23:18
上校
阅读(6651)
评论(0)
推荐(1)
浙公网安备 33010602011771号