关于tx:method和pointcut中的方法,即事务管理中的方法和切入点表达式中的方法具体如何执行

     <tx:advice id="transaction" tranction-manager="transactionManager">
            <tx:attributes>
                <tx:method name="*" isolation="DEFAULT" />
            </tx:attributes>
        </tx:advice>
        
        <aop:config>
            <aop:pointcut expression="* com.kylin.service.*.*(..)" id="point1"/>
            <aop:advisor advice-ref="transaction" pointcut-ref="point1"/>
        </aop:config>
<aop:pointcut expression="* com.kylin.service.*.*(..)" id="point1"/>
这里定义了切入点是:com.kylin.service包下的所有类的全部方法。
tx:method name="*" 这里声明的方法如果包含在切入点里则表示作为一个事务执行。
posted @ 2017-09-26 07:50  KylinStayHere  阅读(2415)  评论(0编辑  收藏  举报