spring中是什么意思


 

  <tx:advice id="tv" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="save*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>

这段话是什么意思

 

意思是这个事物advice的管理者为transactionManager,你从配置文件中应该能够找到一个ID为transactionManager的bean,

而这个建议中规定了save方法的传输方式为required,也就是说没有sessionfactory的时候会自动建立,有的时候就不会建立了。

当然了这只是规定了一个advice,你还需要指定一个aop:pointcut去引用他,例如
  <aop:config>
        <aop:pointcut id="bussinessService"
            expression="execution(public * x.y..*.*(..))" />
        <aop:advisor pointcut-ref="bussinessService"
            advice-ref="tv" />
    </aop:config>

这样这个advice就被联系到了bussinessService这个pointcut上了






免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM