<tx:advice id="serviceAdvice">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="*" rollback-for="java.lang.Exception"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="servicePointcut" expression="execution(* cn.iwoo.service.*.*(..))"/>
<aop:advisor pointcut-ref="servicePointcut" advice-ref="serviceAdvice"/>
</aop:config>
spring的通用事务管理机制
最新推荐文章于 2025-06-23 22:10:18 发布
本文介绍了一种使用AOP(面向切面编程)进行事务管理的配置方式,通过定义切点和服务建议来实现对特定服务方法的读操作限制及异常回滚。
545

被折叠的 条评论
为什么被折叠?



