<org manual>翻译--3.5.7 编辑和调试公式
2013-05-27 22:08
323 查看
ERROR TransactionInterceptor:307 - Application exception overridden by commit exception
错误原因可能为:
Remember only unchecked exceptions cause rollbacks in spring transactions. What is happening is that you're catching the unchecked exception, converting it to a checked exception and then propogating it. The transaction manager does not rollback for RecordExistsException and thinks that your first transaction has succeded. Thats why it tries to save your child objects. You should annotate your service with Code: [code]@Transactional (rollbackFor= RecordExistsException.class)
or have your exception class extend RuntimeException.[/code]
解决办法:
OK, the way I read that an exception occurs and it does indeed do a commit. I would presume there must be a rollback rule defined telling it to do this. Before Spring2.0 might look like this. <prop key="*">PROPAGATION_REQUIRED, -com.mydomain.exception.MyException</prop> http://www.springframework.org/docs/reference/transaction.html#transaction-declarative-txadvice-settings[/code]
相关文章推荐
- &lt;org manual&gt;翻译--3.5.7 编辑和调试公式
- <org manual>翻译--3.5.2 Calc的公式语法
- &lt;org manual&gt;翻译--3.5.5 域公式和区间公式
- &lt;org manual&gt;翻译--2.5 结构编辑
- &lt;org manual&gt;翻译--3.5.3 Emacs Lisp写成的公式
- &lt;org manual&gt;翻译--3.5.2 Calc的公式语法
- <org manual>翻译--3.5.5 域公式和区间公式
- <org manual>翻译--3.5.6 列公式
- &lt;org manual&gt;翻译--2.9 区块
- &lt;org manual&gt;翻译--2.8 抽屉
- &lt;org manual&gt;翻译--4.8 客户化搜索
- <org manual>翻译--3.5.1 引用
- <org manual>翻译--2.3 可见性的转换
- &lt;org manual&gt;翻译--2.7 纯文本列表
- &lt;org manual&gt;翻译--4.7 文件链接中的搜索选项
- &lt;org manual&gt;翻译--2.6 Sparse树
- &lt;org manual&gt;翻译--4.6 链接的缩写
- <org manual>翻译--3.5.9 高级特性
- <org manual>翻译--安装
- &lt;org manual&gt;翻译--1.4 反馈 : BUG报告,好的想法,补丁等等