获取线程级别的session

来源:互联网 发布:sql教学视频 编辑:程序博客网 时间:2024/06/01 07:54

session = HibernateUtil.getSessionFactory().getCurrentSession();

还需要在hibernate.cfg.xml里面配置

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

0 0