解决HIbernate3运行出现No CurrentSessionContext configured!错误
来源:互联网 发布:在线订单提交系统源码 编辑:程序博客网 时间:2024/05/13 20:57
解决HIbernate3运行出现No CurrentSessionContext configured!错误
是由于函数getcurrentsession()造成的,可以将其改为opensession(),也可以进行一下修改:
修改配置文件:hibernate.cfg.xml
根据运行环境添加如下配置:
1)在容器中运行即在集成环境下(例如Jboss),在hibernate.cfg.xml中session-factory段加入:
<property name="current_session_context_class">jta</property>
2) 独立运行:即在不集成Hibernate的环境下(例如使用JDBC的独立应用程序),在hibernate.cfg.xml中session-factory段加入:(myeclipse6.0)
<property name="current_session_context_class">thread</property>
注:hibernate.cfg.xml文件中内容的编写是有顺序的:先“property”,然后是“mapping”,以上内容是“property”,应在“mapping”之上。
- 解决HIbernate3运行出现No CurrentSessionContext configured!错误
- 解决HIbernate3运行出现No CurrentSessionContext configured!错误
- 解决HIbernate3运行出现No CurrentSessionContext configured!错误
- 解决"No CurrentSessionContext configured"错误
- 根据错误原理解决Hibernate运行出现No CurrentSessionContext configured!错误
- "No CurrentSessionContext configured"错误
- No CurrentSessionContext configured 错误
- "No CurrentSessionContext configured"错误
- No CurrentSessionContext configured错误
- "No CurrentSessionContext configured"错误(hibernate)
- 解决"No CurrentSessionContext configured…
- No CurrentSessionContext configured 异常解决
- 错误:org.hibernate.HibernateException:No CurrentSessionContext configured!
- 错误:org.hibernate.HibernateException: No CurrentSessionContext configured!
- 错误:org.hibernate.HibernateException: No CurrentSessionContext configured!
- 错误:org.hibernate.HibernateException: No CurrentSessionContext configured!
- 错误整理(五)No CurrentSessionContext configured!
- Hibernate3.6:org.hibernate.HibernateException: No CurrentSessionContext configured!
- Assembly Manifest 通俗简易手册
- weblogic10.3 java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
- apache代理设置
- Mysql 定位执行效率低的SQL语句
- Vulnerability Summary for CVE-2005-1794 RDP
- 解决HIbernate3运行出现No CurrentSessionContext configured!错误
- Spring核心机制--IoC
- quartz 时间配置规则(转载自http://blog.sina.com.cn/s/blog_59833db10100hnvk.html)
- shell脚本复习
- luncen.net 基本使用,写的不错摘录过来,以后用
- 数据库的导入导出和数据库的附加
- 关于形参和实参
- linux下如何挂接(mount)光盘镜像文件、移动硬盘、U盘、Windows网络共享
- 智能图书馆管理系统