No Hibernate Session bound to thread, and configuration does not allow create解决方案
来源:互联网 发布:三维设计与渲染软件 编辑:程序博客网 时间:2024/05/29 10:02
参考地址:http://forum.spring.io/forum/spring-projects/data/96622-no-hibernate-session-bound-to-thread-and-configuration-does-not-allow-creation-of-no
1、使用注解实现程序
dao @Repository
service @Service @Transactional
controller @Controller @RequestMapping(value="/")
2、配置Spring 3 + Hibernate 3 (MVC)
启动正常,请求数据库错误,后台报No Hibernate Session bound to thread, and configuration does not allow create错误。
但是事务是配置了的,但是貌似是事务的问题,多方寻求无果,最后在spring网站上找到了解决方案。
3、解决方案在web.xml中加入Hibernate的过滤请求将session打开
<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>有关OpenSessionInViewFilter的参考:http://docs.spring.io/spring/docs/3.0.x/javadoc-api/org/springframework/orm/hibernate3/support/OpenSessionInViewFilter.html
0 0
- No Hibernate Session bound to thread, and configuration does not allow create解决方案
- No Hibernate Session bound to thread, and configuration does not allow create解决方案
- No Hibernate Session bound to thread, and configuration does not allow create
- 解决No Hibernate Session bound to thread, and configuration does not allow create tansactional的问题
- 解决No Hibernate Session bound to thread, and configuration does not allow create tansactional的问题
- No Hibernate Session boundNo Hibernate Session bound to thread, and configuration does not allow cr
- Spring+Hibernate 异常No Hibernate Session bound to thread, and configuration does not allow creation
- No Hibernate Session bound to thread, and configuration does not allow creation of non-transactiona
- No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional
- No Hibernate Session bound to thread, and configuration does not allow creation of non-transactiona
- @Transactional未添加就报错:No Hibernate Session bound to thread, and configuration does not allow creation
- No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional
- No Hibernate Session bound to thread, and configuration does not allow 解决办法
- No Hibernate Session bound to thread, and configuration does not allow creation of non-transactiona
- No Hibernate Session bound to thread, and configuration does not allow creat
- HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation
- No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional
- No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional
- Nginx限制ip链接数,Nginx如何限制并发数,同1个IP,nginx怎么限制流量/限制带宽?
- 广州传智播客以实战教学缩短企业与IT人才的差距
- 设计模式概论
- Deep Learning 基本思想和方法
- 库项目文件无法指定 ApplicationDefinition 元素 项目文件包含无效的属性值
- No Hibernate Session bound to thread, and configuration does not allow create解决方案
- 基于DBN的语音识别技术分析
- ARM的CACHE原理(转)
- 递归调用的输出顺序
- java c++ socket 中文乱码解决
- APPLET打印的一些总结
- [转载].NET中datatable的创建,插入列,插入行,排序
- zedboard--zedboard学习小结
- windows下tomcat+phpmyadmin的集合