課程
/后端開(kāi)發(fā)
/Java
/Spring入門(mén)篇
這個(gè)例子中沒(méi)有用到
2017-03-08
源自:Spring入門(mén)篇 5-7
正在回答
<!-- 事務(wù)注解:開(kāi)啟注解支持-->
? ? <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
? ??
? ? <!-- 全局AOP事物,除get,list,select,query開(kāi)頭的方法外,都處在事物當(dāng)中? -->
<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>
<!-- 配置事務(wù)切面 到Service層 -->
<aop:config expose-proxy="true" proxy-target-class="true" >
<aop:advisor advice-ref="txAdvice" pointcut="execution(* com.xt.shop.base.service..*.*(..))"/>
</aop:config>
是沒(méi)有講到,你可以參照一下這個(gè)博客里面的內(nèi)容http://tonl.iteye.com/blog/1966075;
舉報(bào)
為您帶來(lái)IOC和AOP的基本概念及用法,為后續(xù)高級(jí)課程學(xué)習(xí)打下基礎(chǔ)
5 回答沒(méi)有講到<aop:advisor>的實(shí)際使用
2 回答這個(gè)例子用的是代理??
1 回答bean的生命周期在實(shí)際應(yīng)用中有哪些例子?
1 回答這個(gè)例子還需要繼承UnitTestBase嗎
2 回答老師這例子跟advisor有關(guān)系嗎?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-01-25
<!-- 事務(wù)注解:開(kāi)啟注解支持-->
? ? <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
? ??
? ? <!-- 全局AOP事物,除get,list,select,query開(kāi)頭的方法外,都處在事物當(dāng)中? -->
<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>
<!-- 配置事務(wù)切面 到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
是沒(méi)有講到,你可以參照一下這個(gè)博客里面的內(nèi)容http://tonl.iteye.com/blog/1966075;