首页 > Web开发 > 详细

org.hibernate.HibernateException: No CurrentSessionContext configured!

时间:2015-04-07 13:37:24      阅读:312      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!