could not open hibernate session for transactio

2025-02-22 13:56:29
推荐回答(1个)
回答1:

Maybe 缓存同步的问题
您可以
这样获取Session
Session session =HibernateSessionFactory.getSessionFactory().getCurrentSession();
试试
也可是修改Hibernate *.hbm.xml中添加修改一个 lazy属性为false 默认为 true
~$$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~