No Hibernate Session bound to thread, and configuration does not allow creat
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的更多相关文章
- 解决No Hibernate Session bound to thread, and configuration does not allow creat。。。
applicationContext.xml配置 <?xml version="1.0" encoding="UTF-8"?> <beans ...
- org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a ...
- spring事务管理出错。No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy ...
- spring 管理事务配置时,结果 报错: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here这个异常
java.lang.IllegalStateException: No Hibernate Session bound to thread, and configuration does not al ...
- 出现No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here异常
问题描述: public void save(BaseEntity baseEntity) { Session session = null; try { session = currentSessi ...
- org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a
如果出现了这个错误,看看在使用Hibernate的时候有没有在事务的环境下执行操作!
- 报错解决:No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
大概分析一般使用了注解才会报这方面的错 1.没有在spring的ApplicationContext.xml中开启注解事务 <!-- 开启注解事务 --> <tx:annotatio ...
- No Hibernate Session bound to thread, and configuration does not allow
今天晚上挺悲催的,遇到了这个问题花费我很长时间,现在总结如下: 到这这种情况的发生有两种情况: 1,没有配置事物只要在Spring配置文件中添加如下代码: <bean id="txMa ...
- org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not
遇到这个问题之前,我去百度和谷歌去搜索了一下.发现各种说法.可是针对我的项目而言,也就是公司的项目而言,这个问题的根源并不是是网上所说的那样. 最后是通过自己的想法做測试得到了解决. 1.首先说说我的 ...
随机推荐
- 玩转Android之加速度传感器的使用,模仿微信摇一摇
Android系统带的传感器有很多种,最常见的莫过于微信的摇一摇了,那么今天我们就来看看Anroid中传感器的使用,做一个类似于微信摇一摇的效果. OK ,废话不多说,我们就先来看看效果图吧: 当我摇 ...
- android自定义View之仿通讯录侧边栏滑动,实现A-Z字母检索
我们的手机通讯录一般都有这样的效果,如下图: OK,这种效果大家都见得多了,基本上所有的android手机通讯录都有这样的效果.那我们今天就来看看这个效果该怎么实现. 一.概述 1.页面功能分析 整体 ...
- arcgis通过 Python 使用工具 获得结果信息
通过 Python 使用工具 ArcGIS 10 每个地理处理工具都具有一组固定的参数,这些参数为工具提供执行所需的信息.工具通常具有定义一个或多个数据集的输入参数,这些数据集一般用于生成新的输出数据 ...
- Eclipse启动Tomcat访问不了首页
Eclipse开发web项目与myEclipse不同: 启动服务器后访问 http:localhost:8080 找不到服务器 想要访问Tomcat首页只需修改Tomcat配置 进入Eclipse双击 ...
- Redis操作List工具类封装,Java Redis List命令封装
Redis操作List工具类封装,Java Redis List命令封装 >>>>>>>>>>>>>>>> ...
- String filePath = request.getSession().getServletContext().getRealPath("/");这句话返回的路径是什么,解释下getRealPath("/")函数中的"/"表示什么意思
request.getSession().getServletContext() 获取的是Servlet容器对象,相当于tomcat容器了.getRealPath("/") 获取实 ...
- java Spring 基于注解的配置(一)
注解引用:1.service.xml 配置注解模式 <?xml version="1.0" encoding="UTF-8"?> <beans ...
- unity3d最新面试题与参考答案汇总
1.在类的构造函数前加上static会报什么错?为什么? 构造函数格式为 public+类名,如果加上static会报错(静态构造函数不能有访问修饰符)原因:静态构造函数不允许访问修饰符,也不接受任何 ...
- C#微信公众号开发 -- (四)获取API调用所需的全局唯一票据access_token
access_token是公众号的全局唯一票据,公众号调用各接口时都需使用access_token.开发者需要进行妥善保存.access_token的存储至少要保留512个字符空间.access_to ...
- gdal中文路径无法打开问题
在C#中使用OGR读写矢量数据时,需要引用“using OSGeo.OGR;”. 同时为了处理中文路径和中文字段,需要在开始设置下面两个属性,代码如下: //为了支持中文路径,请添加下面这句代码(大多 ...