No Session found for current thread
来源:互联网 发布:java初级招聘北京 编辑:程序博客网 时间:2024/05/22 08:28
DAO中要用getCurrentSession来获得session的话报No Session found for current thread
解决办法:
dao方法不要openSession,要获取当前session,不要关闭session:
Session session=sessionFactory.getCurrentSession()
dao只需要直接注入sessionFactory,不需要继承hibernatedaosupport之类的;
另外,需要service层一定要配置好声明事务!
0 0
- No Session found for current thread
- No Session found for current thread
- No Session found for current thread
- Hibernate4 No Session found for current thread
- No Session found for current thread
- getSessionFactory No Session found for current thread
- 【JAVA】No Session found for current thread
- 单元测试 : No Session found for current thread
- Exception:No Session found for current thread
- no session found for current thread异常
- No Session found for current thread
- org.hibernate.HibernateException: No Session found for current thread
- org.hibernate.HibernateException No Session found for current thread
- org.hibernate.HibernateException: No Session found for current thread
- spring+hibernate4 报错No Session found for current thread
- org.hibernate.HibernateException: No Session found for current thread
- org.hibernate.HibernateException: No Session found for current thread
- Spring-Hibernate - No Session found for current thread
- 编码规范系列(二):Eclipse Checkstyle配置
- Unity3D开发者总结的5点工作经验
- Buffer类的详解
- JQuery中$.ajax()方法参数详解
- 架构师职责
- No Session found for current thread
- 数据库连接池(Oracle,Mysql,SQLite)
- Linux学习之路。
- Eclipse安装JD-Eclipse反编译插件
- 设计模式(创建型)
- 互联网产品经理职能与职责
- 系统性能loadrunner应用
- Ubuntu 12下整合Apache Web Server 和Tomcat
- 百度编辑器ueditor 在vs2008中的使用方法