springAPI对事物支持之XML式配置









<tx:advice id="txAdvice" transaction-manager="transactionManager">

tx:attributes
<tx:method name="" propagation="REQUIRED" read-only="false" />
<tx:method name="find
" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>


aop:config

<aop:pointcut id="pt1" expression="execution(* com.itheima.service.impl..(..))"></aop:pointcut>

<aop:advisor advice-ref="txAdvice" pointcut-ref="pt1"></aop:advisor>
</aop:config>

posted @ 2020-07-13 20:31  jock_javaEE  阅读(148)  评论(0)    收藏  举报