原文:【Spring】21、用spring目标对象处理Transaction rolled back because it has been marked as rollback-only

在使用spring做事务管理时,很多人都会遇到这样一段异常: 出现上面问题的场景类似下面代码这样: ITestAService: TestAService: TestBService: 测试用例: testAService调用testBService的testB 方法,testB 方法里抛了一个BusinessException异常,但是testAService用try catch 捕获异常并不往 ...

2017-07-26 17:51 0 8268 推荐指数:

查看详情

Transaction rolled back because it has been marked as rollback-only

spring的声明事务提供了强大功能,让我们把业务关注和非业务关注的东西又分离开了。好东西的使用,总是需要有代价的。使用声明事务的时候,一 个不小心经常会碰到“Transaction rolled back because it has been marked as rollback-only ...

Sat Nov 14 01:32:00 CST 2015 0 1935
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM