<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="aaaManager" parent="txProxyTemplate">
<property name="target">
<bean class="com.benny.bl.impl.AaaManagerImpl">
<property name="dao"><ref bean="aaaDao"/></property>
</bean>
</property>
</bean>
这是spring 事务配置的另外一种方法
本文介绍了一种使用Spring框架进行事务管理的配置方法。通过定义TransactionProxyFactoryBean来设置事务传播级别,并利用HibernateTransactionManager实现具体事务管理。同时,还展示了如何为业务组件配置事务代理。
1059

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



