hibernate 使用sessionfactory的getCurrentSession()方法发生异常

异常信息:

No CurrentSessionContext configured!

 

解决方法:

在hibernate.cfg.xml文件中的sessionFactory的配置节点中配置如下一段

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

posted @ 2011-02-15 19:55  seed_lee  阅读(834)  评论(0编辑  收藏  举报