1.声明事务管理器bean
<bean id="myHibTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
2.声明事务通知bean
<tx:advice id="txAdvice"
transaction-manager="myHibTransactionManager">
<tx:attributes>
<tx:method name="swopName*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
3.声明切面bean
<aop:config>
<aop:pointcut id="methods" expression="execution(* test09.biz.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="methods" />
</aop:config>
spring 2.x 声明式事务
最新推荐文章于 2024-09-11 00:01:46 发布