读书人

Spring回滚失败的一些缘故

发布时间: 2013-10-27 15:21:50 作者: rapoo

Spring回滚失败的一些原因
这个东西一定要配置
<tx:method name="*" rollback-for="Exception"/>

然后在拦截的层里
要么就不写try catch

写try catch,如果是往外抛的异常--throws Exception,要写
throw new Exception("");

如果没有往外抛出异常就写
throw new RuntimeException("");

不然spring认不到。

还有可能

表不支持支持事务,mysql下必须为InnoDB

mysql为绿色版的缘故,改装正式版试试

读书人网 >开源软件

热点推荐