課程
/后端開發
/Java
/Spring入門篇
這個例子中沒有用到
2017-03-08
源自:Spring入門篇 5-7
正在回答
<!-- 事務注解:開啟注解支持-->
? ? <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
? ??
? ? <!-- 全局AOP事物,除get,list,select,query開頭的方法外,都處在事物當中? -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="select*" propagation="REQUIRED" read-only="true" />
<tx:method name="get*" propagation="REQUIRED" read-only="true" />
<tx:method name="list*" propagation="REQUIRED" read-only="true" />
<tx:method name="query*" propagation="REQUIRED" read-only="true" />
<tx:method name="*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception"/>
</tx:attributes>
</tx:advice>
<!-- 配置事務切面 到Service層 -->
<aop:config expose-proxy="true" proxy-target-class="true" >
<aop:advisor advice-ref="txAdvice" pointcut="execution(* com.xt.shop.base.service..*.*(..))"/>
</aop:config>
是沒有講到,你可以參照一下這個博客里面的內容http://tonl.iteye.com/blog/1966075;
舉報
為您帶來IOC和AOP的基本概念及用法,為后續高級課程學習打下基礎
5 回答沒有講到<aop:advisor>的實際使用
2 回答這個例子用的是代理??
1 回答bean的生命周期在實際應用中有哪些例子?
1 回答這個例子還需要繼承UnitTestBase嗎
2 回答老師這例子跟advisor有關系嗎?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-01-25
<!-- 事務注解:開啟注解支持-->
? ? <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
? ??
? ? <!-- 全局AOP事物,除get,list,select,query開頭的方法外,都處在事物當中? -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="select*" propagation="REQUIRED" read-only="true" />
<tx:method name="get*" propagation="REQUIRED" read-only="true" />
<tx:method name="list*" propagation="REQUIRED" read-only="true" />
<tx:method name="query*" propagation="REQUIRED" read-only="true" />
<tx:method name="*" propagation="REQUIRED" read-only="false" rollback-for="java.lang.Exception"/>
</tx:attributes>
</tx:advice>
<!-- 配置事務切面 到Service層 -->
<aop:config expose-proxy="true" proxy-target-class="true" >
<aop:advisor advice-ref="txAdvice" pointcut="execution(* com.xt.shop.base.service..*.*(..))"/>
</aop:config>
2017-03-12
是沒有講到,你可以參照一下這個博客里面的內容http://tonl.iteye.com/blog/1966075;