sping只有捕获RuntimeException 才回滚
 <tx:method   name="*"   propagation="SUPPORTS"/>  指此方法可以运行在事务中,也可以不运行在事务中

解决方案 »

  1.   

    用這個試試:
    org.springframework.transaction.interceptor.TransactionProxyFactoryBean大致配置如下:(自行查看相關文檔)
    <bean id="dualServiceWithJTA"
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager">
    <ref bean="transactionManager" />
    </property>
    <property name="target">
    <ref local="dualServiceBean" />
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>
      

  2.   

    配置rollback-for:Exception就好了如果不填写rollback-for默认是runtimeexception才回滚。。