throw new RuntimeException()呢?

解决方案 »

  1.   

    首先 throw new Error(); 就是错误的
    只有RuntimeException 才会回滚
    其二
    userDao你是怎么做的...
    如果你是自己opensession的 那也不会回滚
    必须要拿线程中的session才可以
      

  2.   

    saveUser方法所属类的包路径呢?
      

  3.   

    datasource autocommit 设置为false
      

  4.   

    spring默认是只有抛出运行时异常时才回滚事务,就是RuntimeException以及其子类。
      

  5.   

    谢谢各位,解决了,是springmvc扫描配置的不对