惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
博客园 - 叶小钗
爱范儿
爱范儿
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
T
Tailwind CSS Blog
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - Squall

Spring2.5中基于注释的IoC struts2登录拦截器 Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AU Lucene中使用Paoding中文分词 ibatis VS hibernate 经典论述 超越传统软件开发技术 ASP 缩略图 (纠错版) persits.jpeg 破解版下载 Cant connect to SQL server with jtds 1.2.2 - Squall The hibernate core class ------ ExportToDB Struts+spring使用随机验证码 SSH 异常 解决 方案 总结 Struts-Logic 标签库 structs - 标签库(html) spring2.0 事务管理以及异常处理之体会 Could not open ServletContext resource [/WEB-INF/applicationContext.xml] myeclipse tomcat 部署错误 ASP 通过正则提取信息内容种的图片 div+css 绝对定位和相对定位
hibernate.current_session_context_class 错误 - Squall - ...
Squall · 2009-07-02 · via 博客园 - Squall

在使用SessionFactory的getCurrentSession方法时遇到如下错误,经过检查,原因如下:

是因为在hibernate.cfg.xml文件中忘记进行了如下设置:hibernate.current_session_context_class

如果是在web容器中运行hibernate,则在hibernate.cfg.xml中加入这句话:

<property name="hibernate.current_session_context_class">jta</property>

如果是在一个单独的需要进行JDBC连接的java application中运行hibernate,则这样设置:

<property name="hibernate.current_session_context_class">thread</property>

本文属于转帖。