Write operations are not allowed in read-only mode

http://blog.sina.com.cn/s/blog_5dc12c490100crr5.html

OpenSessionInViewFilter配置
<web-app> 
  ... 
  <filter> 
     <filter-name>hibernateFilter</filter-name>
     <filter-class>
       org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
     </filter-class>
     <!-- singleSession默认为true,若设为false则等于没用OpenSessionInView -->
     <init-param>
       <param-name>singleSession</param-name>
       <param-value>true</param-value> 
     </init-param> 
   </filter> 
   ...
   <filter-mapping>
     <filter-name>hibernateFilter</filter-name> 
     <url-pattern>*.do</url-pattern>
   </filter-mapping>
   ... 
 </web-app>

猜你喜欢

转载自panyongzheng.iteye.com/blog/1412193