恩,主要就是:我配置了一个事务的管理advisor 和一个日志管理的aspect,但是当他们切入同一个包的时候,事务就管用了。(其中,之前事务是可以用的。同时,如下,我在第一个config里配置了2个代理分别是事务和日志的是管理service包的,在第二个config里配置了切入其他包的aspect)
目前,情况就是日志的好用,而事务失灵了。抛出异常并不发生回滚了。请大侠指点高招。<!-- aop 切入事务管理到 -->
<tx:advice id="txAdvice" transaction-manager="jotm_txManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" rollback-for="Exception" />
<tx:method name="insert*" propagation="REQUIRED" rollback-for="Exception" />
<tx:method name="del*" propagation="REQUIRED" rollback-for="Exception" />
<tx:method name="update*" propagation="REQUIRED" rollback-for="Exception" />
<tx:method name="mod*" propagation="REQUIRED" rollback-for="Exception" />
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>
<!-- cglib代理service  -->
<aop:config proxy-target-class="false">
<aop:pointcut id="allServiceMethod" expression="execution (* com.sinosoft.perfect.*.*.service.*.*(..))
|| execution (* com.sinosoft.perfect.*.service.*.*(..))"/>
<aop:advisor order="1" advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
<aop:aspect id="loggerAspect2" ref="genericLoggerBean2" order="1000">
            <aop:around pointcut-ref="allServiceMethod" method="invoke"  />  
        </aop:aspect>
</aop:config>
<!-- aop 切入日志 -->
<aop:config proxy-target-class="true">
<aop:aspect id="loggerAspect" ref="genericLoggerBean">
            <aop:around pointcut="execution(* com.sinosoft.perfect.*.*.action.*.*(..))
             ||execution(* com.sinosoft.perfect.common.action.*.*(..))" method="invoke" />  
        </aop:aspect>
</aop:config>

<!-- aop 切入日志 -->
<bean id="genericLoggerBean" class="com.sinosoft.perfect.common.bean.GenericLoggerBean"></bean>
<bean id="genericLoggerBean2" class="com.sinosoft.perfect.common.bean.GenericLoggerBean2"></bean>