本来插入两次,应该是 出现 “唯一主键约束”的异常,然后,应该事物回滚,但是插入一条成功了,代码如下:
@At
@Aop(TransAop.READ_COMMITTED)
public void insert(@Param("i")String i)throws Exception {
int aa=Integer.parseInt(i);
User u = new User(aa, "111", new Date());
dao.insert(u);
User u2 = new User(aa, "222", new Date());
try {
dao.insert(u2);
} catch (Exception e) {
e.printStackTrace();
throw e;
} finally {
}
}