问题是遇到数据库抛出的异常回滚成功,抛出java.lang.ArrayIndexOutOfBoundsException不回滚!!
编程式事务管理,配置如下:
 <bean id="baseTxService"
     class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
     abstract="true">
     <property name="transactionManager" ref="transactionManager" />
     <property name="proxyTargetClass" value="true" />
     <property name="transactionAttributes">
     <props>
     <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
     <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
     <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
     <prop key="*Regist*">PROPAGATION_REQUIRED</prop>
     <prop key="update*">PROPAGATION_REQUIRED</prop>
     <prop key="remove*">PROPAGATION_REQUIRED</prop>
     </props>
     </property>
     <property name="preInterceptors">
     <list>
     <ref bean="methodCachePointCut" />
     <ref bean="methodCachePointCutAdvice" />
     </list>
     </property>
    </bean>    <bean id="accountManager" parent="baseTxService">
     <property name="target" ref="passPortBOImpl">
    
     </property>
    </bean>
。。

解决方案 »

  1.   

    accountManager,passPortBOImpl这两面如何写的
    配置上没看出问题
      

  2.   

    方法名以  <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
                    <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
                    <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
                    <prop key="*Regist*">PROPAGATION_REQUIRED</prop>
                    <prop key="update*">PROPAGATION_REQUIRED</prop>
                    <prop key="remove*">PROPAGATION_REQUIRED</prop>这些开头了么
      

  3.   

    spring管理下的hibernate默认是对Exception不回滚的,只对RuntimeException回滚
     <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">  
            <property name="transactionManager" ref="transactionManager" />  
            <property name="transactionAttributes">  
                <props>  
                    <prop key="*">PROPAGATION_REQUIRED,-Exception</prop>  
                </props>  
            </property>  
        </bean> 
    添加下看看
      

  4.   


    我用的是IBATIS,这样配也不能回滚,hibernate好像是可以回滚
    我加上了下面这些,可以捕获到所有Exception了。
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
    <tx:method name="*" propagation="REQUIRED" rollback-for="Exception" />
    </tx:attributes>
    </tx:advice>
      

  5.   

    <aop:config>里路径是否正确
      

  6.   

    我之前的ibatis应用,
    也是加上rollback-for才回滚的。例子上并没有这么写不明白bdgood luck