hibernate.current_session_说明
遇到过的问题: 情景1: 在使用SessionFactory的getCurrentSession方法时遇到如下错误,经过检查,原因如下: 是因为在hibernate.cfg.xml文件中忘记进行了如下设置: hibernate.current_session_context_class如果是在web容器中运行hibernate,则在hibernate.cfg.xml中加入这句话: <property name="hibernate.current_session_context_class">jta</property> 如果是在一个单独的需要进行JDBC连接的java application中运行hibernate,则这样设置: <property name="hibernate.current_session_context_class">thread</property> 情景2: 在ssh2中的sessionFactory配置文件中 应将hibernate.current_session_context_class设为org.springframework.orm.hibernate3.SpringSessionContext(默认为此值) 并应用spring管理事务。如果为<prop key="hibernate.current_session_context_class