熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java開源技術 >> 正文

spring 2.0 的事務自動處理

2022-06-13   來源: Java開源技術 

  <aop:config>
        <!<aop:advisor id=userManagerTx adviceref=userManagerTxAdvice pointcut=execution(* *serviceUserManager*()) order=/>>       
        <!<aop:advisor id=userManagerSecurity adviceref=userSecurityAdvice pointcut=execution(* *serviceUserManagersaveUser()) order=/>>
        <aop:advisor id=managerTx adviceref=txAdvice pointcut=execution(* *service*Manager*()) || execution(* *service*Service*()) order=/>
    </aop:config>
   
    <tx:advice id=txAdvice>
        <tx:attributes>
            <tx:method name=get* propagation=SUPPORTS readonly=true/>
            <tx:method name=save* propagation=REQUIRED/>
            <tx:method name=update* propagation=REQUIRED/>
            <tx:method name=remove* propagation=REQUIRED/>
            <tx:method name=* propagation=SUPPORTS/>
        </tx:attributes>
    </tx:advice>

  <! Transaction manager for a single JDBC DataSource >
    <bean id=transactionManager class=orgspringframeworkjdbcdatasourceDataSourceTransactionManager>
        <property name=dataSource ref=dataSource/>
    </bean>


From:http://tw.wingwit.com/Article/program/Java/ky/201311/28458.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.