数据库没有数据时报错日常

 

2.java.lang.RuntimeException: No CurrentSessionContext configured!

没有CurrentSession上下文配置! 这就想到了我们在利用CurrentSession的时候,其实就是getCurrentSession的时候没有在hibernate.cfg.xml文件中配置!

所以解决问题的办法就是根据需求在hibernate.cfg.xml文件中加上上边的配置即可!

<property name="hibernate.current_session_context_class">thread</property>

相关文章:

  • 2021-12-25
  • 2023-03-19
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-12-18
  • 2021-08-24
  • 2021-12-29
相关资源
相似解决方案