<bean id="userManager"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>com.test.UserManager</value>
</property>
<property name="interceptorNames">
<list><idref local="transactionInterceptor"/></list>
</property>
</bean>
使用TransactionProxyFactoryBean:
<bean id="userManager"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="target"><ref local="userManagerTarget"/></property>
<property name="transactionAttributes"><props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property></bean>
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/