问答详情
源自:2-5 session详解(上)

在hibernate.cfg.xml里设置了current_session_context_class为thread,但还是不能正常的输出demo

在hibernate.cfg.xml里设置了current_session_context_class为thread,但还是不能正常的输出demo

提问者:Tony_0105 2017-08-03 10:19

个回答

  • 慕少7573967
    2017-10-15 21:20:21

    可能你current的代码没改session调用的方法getcurrentSession

  • Tony_0105
    2017-08-03 14:50:51

    可以,只有getCurrentSession的时候不行,debug看了一下,getCurrentSessionContext为空

  • 慕侠0191110
    2017-08-03 10:59:52

    报的生命错误,openSession能正常运行吗?