`
a11632
  • 浏览: 7529 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
社区版块
存档分类
最新评论

spring事务管理

 
阅读更多

<bean id="transactionManager"
       class="org.springframework.orm.hibernate3.HibernateTransactionManager">
   <property name="sessionFactory" ref="sessionFactory"></property>
</bean>

 

<tx:advice id="txAdvice" transaction-manager="transactionManager">
   <tx:attributes>
     <tx:method name="update*" propagation="REQUIRED" />
     <tx:method name="save*" propagation="REQUIRED" />
     <tx:method name="del*" propagation="REQUIRED" />
     <tx:method name="*" read-only="true" />
   </tx:attributes>
</tx:advice>

 

<aop:config proxy-target-class="true" >
   <aop:pointcut expression="execution(* com.love2825.daoImpl.*.*(..))"
       id="allMethod" />
   <aop:advisor advice-ref="txAdvice" pointcut-ref="allMethod" />
</aop:config>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics