关于事物。问个问题
if (a.contains("1")) {
dao.update(1);
}
else if (a.contains("2")) {
dao.update(2);
}
else if (a.contains("3")) {
dao.update(3);
}
第一次可以更新,剩下就报异常了
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
该怎么解决呢?
------解决方案--------------------你的事务传播途径是啥样的?是PROPAGATION_REQUIRES_NEW的吗?
------解决方案--------------------你看看这个:
http://yidianfengfan.iteye.com/blog/550826