使用TransactionProxyFactoryBean
<!-- 定义事务拦截器 -->
<bean id="businessProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref local="transactionManager" />
</property>
<property name="target">
<ref local="userDaoTarget" />
</property>
<property name="transactionAttributes">
<props>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
帮帮忙,红色的重点解释下,零基础,越详细越好,谢谢,谢谢。
TransactionProxyFactoryBean只是为组件的事务代理,
如果我们要给组件添加一些业务方面的验证等,
可以使用TransactionTemplate加拦截器方式,为组件添加多个拦截器
具体代码说明最好,上面代码是没有理解,都在里面,希望能详细解答一下,谢谢。谢谢!!