首页 > Web开发 > 详细

No Hibernate Session bound to thread, and configuration does not allow creat

时间:2015-11-02 19:13:27      阅读:320      评论:0      收藏:0      [点我收藏+]

No Hibernate Session bound to thread, and configuration does not allow creat

今天遇到这么一个错误,在网上差了很多都没有能解决我的问题。transactional注解也添加了,各种配置也都没问题,结果快纠结死了。

最终在一个回复里面发现,原来是opensessionInView这个filter没有配置导致的。

具体原理不明,暂且记下来。

<!-- Hibernate Open Session in View filter --> 
<filter> 
<filter-name>openSessionInViewFilter</filter-name> 
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> 
</filter> 
...... 

<filter-mapping> 
<filter-name>openSessionInViewFilter</filter-name> 
<url-pattern>/*</url-pattern> 
</filter-mapping> 

 

No Hibernate Session bound to thread, and configuration does not allow creat

原文:http://www.cnblogs.com/my-king/p/4930832.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!