我不断收到:
Hibernate异常:否
CurrentSessionContext已配置!
在我的代码中。其他搜索返回的唯一信息是罪魁祸首是:
<property name="current_session_context_class">thread</property>
在我的 hibernate.cfg.xml 中。我的 hibernate.cfg.xml 文件中确实有该文件,并且我在 Tomcat 6 中运行它。有谁知道其他可能的原因吗?
我相信您需要将 current_session_context_class 设置为实际的类...我已为此配置了 hibernate.cfg.xml,如下所示:
<property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>
上面的代码用于 mySql 数据库,但我认为上述属性的数据库类型并不重要
希望这可以帮助
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)