我使用spring的声明式事务,为一个包的下的所有*Manager的所有方法声明了事务管理,当我在一个方法里使用throw new Exception("error");手工抛出异常时,事务没有回滚,但当我在代码中间加上使用一个除以零的代码时,系统抛出by zero的异常,事务正常回滚了。相关配置如下:[code="java"]
<aop:advisor pointcut="execution(* com.prize.service.*Manager.*(..))" advice-ref="txAdvice"/>
</aop:config>
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="find*" read-only="true"/>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>[/code]
请问是什么原因?如何手工让事务回滚呢?