spring配置事务application.xml

原文地址为: spring配置事务application.xml

 
  
<!-- 使用注解方式定义事务 -->	<tx:annotation-driven proxy-target-class="true" transaction-manager="transactionManager" />
<!-- 配置事务管理器 --><bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">		<property name="sessionFactory" ref="sessionFactory" /></bean>

<!-- 配置事务传播特性 -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="get*" read-only="true"/>
<tx:method name="load*" read-only="true"/>
<tx:method name="find*" read-only="true"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>

	<!-- 配置哪些类的哪些方法参与事务 -->	<aop:config>		<aop:advisor pointcut="execution(* com.sdjz.eshop.service.*..*.*(..))" advice-ref="transactionAdvice" />	</aop:config>


转载请注明本文地址: spring配置事务application.xml

猜你喜欢

转载自blog.csdn.net/zhengxiuchen86/article/details/80941098
今日推荐