配置文件hibernate.cfg.xml
在集成Hibernate的环境下(例如Jboss),在hibernate.cfg.xml中session-factory段加入:
<property name="current_session_context_class">jta</property>
在不集成Hibernate的环境下(例如使用JDBC的独立应用程序),在hibernate.cfg.xml中session-factory段加入:
<property name="current_session_context_class">thread</property>
在集成Hibernate的环境下(例如Jboss),在hibernate.cfg.xml中session-factory段加入:
<property name="current_session_context_class">jta</property>
在不集成Hibernate的环境下(例如使用JDBC的独立应用程序),在hibernate.cfg.xml中session-factory段加入:
<property name="current_session_context_class">thread</property>
本文介绍了如何在集成Hibernate的环境(如Jboss)及未集成Hibernate的环境(如使用JDBC的独立应用程序)中设置hibernate.cfg.xml配置文件,通过设置current_session_context_class属性来指定会话管理方式。
380

被折叠的 条评论
为什么被折叠?



