小问题418_01

错误提示:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

解决方法:

<filter>
<!--懒加载,因为查询的时没有向数据库发送查询语句,因为没有使用,当JSP页面使用的时候,Session已经提交无法加载-->
<filter-name>openSessionInView</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>

在以上部分加上加粗部分字体

posted on 2017-04-18 14:17  火影不火  阅读(67)  评论(0编辑  收藏  举报