本帖最后由 wuwei35531 于 2013-02-05 21:31:45 编辑

解决方案 »

  1.   

    <tx:advice id="txAdvice" transaction-manager="transactionManager">  
            <tx:attributes>  
                <tx:method name="get*" read-only="true" />  
                <tx:method name="*" />  
            </tx:attributes>  
    </tx:advice>  这个写错了,没有配在什么情况下回滚,加上 rollback-for="UnsupportedOperationException"
      

  2.   


    UnsupportedOperationException是 RuntimeException异常的子类,是默认回滚的
      

  3.   

    mysql数据库引擎是否为innodb?
    这个引擎才支持事务的。其他的不支持
      

  4.   

    insertFoo内部抛出异常,外部没显示throws,难道没报错???还是因为是unchecked异常的原因
      

  5.   

    官方例子不一定完整,自己按那思想,做一个demo看是否有问题就行了。
      

  6.   

    楼主  你的问题解决了吗  用什么方法 我也遇到了 提示 Rolled back transaction after test execution for test context  表是innodb类型的   不会回滚,请指教了