您的位置:首页 > 编程语言 > Java开发

关于spring事务提交的随笔

2014-10-20 10:58 393 查看
<bean id="iChApplyService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">

<property name="transactionManager" ref="transactionManagerCheck2"/>

<property name="target" ref="iChApplyServiceTarget"/>

<property name="transactionAttributes">

<props>

<prop key="*">PROPAGATION_REQUIRED,-Exception</prop>

</props>

</property>

</bean>

-Exception选项 如果在iChApplyServiceTarget的方法内对抛出的异常进行了处理,则-Exception会导致事务回滚

+Exception则会提交,不配置也会提交

而如果在iChApplyServiceTarget的调用方进行处理,则不配置也会回滚.

原理不明,望指导
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: