1 回答
已采納

qq_20151109_0
TA貢獻22條經(jīng)驗 獲得超11個贊
用注解 配上數(shù)據(jù)源,在加這個就行了<tx:annotation-driven transaction-manager="txManager" />
不用注解:就這樣
<!-- 通知 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
? <tx:attributes>
? ? ?<!-- 傳播行為 -->
? ? ?<tx:method name="find*" propagation="REQUIRED" />
? ? ?<tx:method name="do*" propagation="REQUIRED" />
? ? ?<tx:method name="*" propagation="SUPPORTS" read-only="true" />
? </tx:attributes>
</tx:advice>
<!-- 切面 -->
<aop:config>
? <aop:advisor advice-ref="txAdvice"
? ? ?pointcut="execution(* 寫上你的包路徑.*.*(..))" />
</aop:config>
添加回答
舉報
0/150
提交
取消