一个service方法就是一个事务read-only="true" />name 是配的dao层的方法roolback-for 需要回滚的异常名称如果不写roolback-for,spring默认RuntimeException、UncheckedException及error才会回滚;如果异常被try{ }catch(){}了,事务就不会回滚了;如果要想让事务回滚,则必须在catch里面再往外抛异常try{ }catch(){throw newException}