在hibernate.cfg.xml配置如下:
<property name="hibernate.current_session_context_class">thread</property>
Hibernate使用getCurrentSession() 的配置
原文:https://www.cnblogs.com/SasaL/p/11652072.html