日期:2014-05-17  浏览次数:20784 次

Spring AOP配置死活不起作用,求救
无论怎么试都无法回滚

AOP配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/aop
           http://www.springframework.org/schema/aop/spring-aop.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx.xsd">
    
    <!-- AOP事务 -->
    <tx:advice id="DomainTxAdvice" transaction-manager="transactionManager">
     <tx:attributes>
     <tx:method name="delete*" propagation="REQUIRED"/>
     <tx:method name="remove*" propagation="REQUIRED"/>
     <tx:method name="update*" propagation="REQUIRED"/>
     <tx:method name="save*" propagation="REQUIRED"/>
     <tx:method name="create*" propagation="REQUIRED"/>    
     <tx:method name="insert*" propagation="REQUIRED"/>
     <tx:method name="add*" propagation="REQUIRED"/>
     <tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
     <tx:method name="load*" propagation="SUPPORTS" read-only="true"/>
     <tx:method name="query*" propagation="SUPPORTS" read-only="true"/>
     <tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
     <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
     </tx:attributes>
    </tx:advice>
    
    <aop:config proxy-target-class="true">
     <aop:pointcut id="DomainServices" expression="execution(* rsj.frdc.domain..service..*.*(..))"/>
     <aop:advisor pointcut-ref="DomainServices" advice-ref="DomainTxAdvice"/>
    </aop:config>
</beans> 


希望匹配的其中一个方法:
rsj.frdc.domain.datacleaner.schedule.fixplan.service.impl.DirtyRecordFixPlanService.save

方法中人为抛出一个异常:

public void save(DirtyRecordFixRule rule) {
dirtyRecordFixRuleDAO.insert(rule);
throw new RuntimeException("出