码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-11-02 19:14:24      阅读:251      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!