打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
applicationContext.xml 事务配置

<!-- 配置事务管理器 -->
<bean id="transactionManager"
   class="org.springframework.orm.hibernate3.HibernateTransactionManager">
   <property name="sessionFactory">
    <ref bean="sessionFactory" />
   </property>
</bean>
<!-- 配置事务的传播特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
   <tx:attributes>
    <tx:method name="add*" propagation="REQUIRED" />
    <tx:method name="save*" propagation="REQUIRED" />
    <tx:method name="del*" propagation="REQUIRED" />
    <tx:method name="update*" propagation="REQUIRED" />
    <tx:method name="*" read-only="true" />
   </tx:attributes>
</tx:advice>
<!-- 那些类的哪些方法参与事务 -->
<aop:config>
   <aop:pointcut id="allManagerMethod" expression="execution(* com.modules.*.service.imp.*.*(..))" />
     <aop:advisor pointcut-ref="allManagerMethod" advice-ref="txAdvice" />
     </aop:config>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
spring + ibatis 多数据源事务(分布式事务)管理配置方法(转)
Spring3.0中的事务控制的配置方法
如何使用spring声明式事务
Spring中使用DataSourceTransactionManager进行事务管理的xml配置
声明式事务管理
异常捕获不抛出,Spring事务无法回滚
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服