<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>
<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的调用方进行处理,则不配置也会回滚.
原理不明,望指导
本文探讨了Spring框架中事务管理的基本概念,重点介绍了如何在事务代理中配置事务属性,并阐述了异常处理对事务行为的影响。包括事务的提交与回滚机制,以及不同异常处理策略对事务最终状态的影响。
6215

被折叠的 条评论
为什么被折叠?



