spring事务默认运行时异常回滚,RuntimeException
配置时添加异常回滚 rollback-for="Throwable"
<aop:pointcut id="transactionPointcut"
expression="execution(* com.dctrain.service..*.*(..))" />
<aop:advisor advice-ref="txAdvice"
pointcut-ref="transactionPointcut" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="save*" rollback-for="Throwable" />
<tx:method name="update*" rollback-for="Throwable" />
<tx:method name="delete*" rollback-for="Throwable" />
<tx:method name="*" read-only="true"
propagation="NOT_SUPPORTED" />
</tx:attributes>
</tx:advice>