Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition在程序中出现该异常的时候,可以通过如下方法解决:
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>false</param-value>
</init-param>
</filter>
注意以上红色部分,增加后,可以解决该问题!