`
freegaga
  • 浏览: 32208 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

spring事物传播和隔离级别

 
阅读更多
<bean id="txManager"
  class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  <property name="sessionFactory" ref="sessionFactory" />
 </bean>

 <aop:config>
  <aop:pointcut id="bussinessService"
   expression="execution(public * com.service..*.*(..))" />
  <aop:advisor pointcut-ref="bussinessService"
   advice-ref="txAdvice" />
 </aop:config>

 <tx:advice id="txAdvice" transaction-manager="txManager">
  <tx:attributes>
   <tx:method name="getUser" read-only="true" />
   <tx:method name="*" propagation="REQUIRED"/><!--所有的方法都有传播特性-->
  </tx:attributes>
 </tx:advice>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics