Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushM

在执行this.getHibernateTemplate().update(a);时,报出这个错误,错误提示很明显,照网上的方法设置了很久也没有搞定,大多是在web.xml中设置filter,但是并不奏效。最后在一篇博文回复中看到了解决方法,通过在applicationContext.XML中设置事务传播行为类型 ,成功解决问题Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushM


再推荐给大家一篇文章,写得很好http://blog.sina.com.cn/s/blog_4b5bc0110100z7jr.html