org.hibernate.HibernateException: No CurrentSessionContext configured!

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

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

posted @ 2015-04-07 12:43  wonkju  阅读(170)  评论(0)    收藏  举报