转自:https://ask.csdn.net/questions/756109

!-- 配置事务管理器 --> <tx:advice id="advice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*" propagation="REQUIRED"/><!-- *是对所有方法都加 --> </tx:attributes> </tx:advice> <!-- 用切点把事务切进去 --> <aop:config> <aop:pointcut expression="execution(* com.stock.*.*(..))" id="pointcut"/> <aop:advisor advice-ref="advice" pointcut-ref="pointcut"/> </aop:config>

posted on 2019-07-23 20:33  Sharpest  阅读(446)  评论(0编辑  收藏  举报