<!-- 配置事务传播特性 -->
<tx:advice id="jdbcTxAdvice" transaction-manager="jdbcTransactionManager">
<tx:attributes>
<tx:method name="test*" propagation="REQUIRED"/>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="find*" propagation="REQUIRED"/>
<tx:method name="get*" propagation="REQUIRED"/>
<tx:method name="apply*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<!-- 配置参与事务的类 -->
<aop:config>
<aop:pointcut id="allTestServiceMethod1" expression="execution(* com.cyb.service.*.*(..))"/>
<aop:advisor pointcut="execution(* com.cyb.dao.*.*(..))" advice-ref="jdbcTxAdvice" />
<aop:advisor pointcut-ref="allTestServiceMethod1" advice-ref="jdbcTxAdvice" />
</aop:config>
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="false"/>
spring事务配置
最新推荐文章于 2022-03-25 16:20:58 发布