码迷,mamicode.com
首页 > Web开发 > 详细

org.hibernate.HibernateException: No CurrentSessionContext configured!

时间:2015-04-07 13:37:45      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

  hibernate可以通过两种方式获得Session: getCurrentSession() 和openSession().

  当通过getCurrentSession()方法时,需要在 hibernate.cfg.xml配置文件中添加: <property name="current_session_context_class">thread</property>

org.hibernate.HibernateException: No CurrentSessionContext configured!

标签:

原文地址:http://www.cnblogs.com/listened/p/4397979.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!