什么时候DB线程被杀死-休眠会话或会话工厂结束?

我们可以通过

关闭会话
sessionfactory=new Configuration().configure().buildSessionFactory();
session = sessionfactory.openSession();
session.close();
sessionfactory.close();

假设已观察到一个缓慢的查询,并希望关闭它并且应该释放数据库...

1) When does DB thread gets killed on the above code on - session.close() or sessionFactory.close()
2) Difference between session.close() vs sessionFactory.close()
3) Which is a best practice - to close the session or close the factory
4) When we force to close the session or session factory - will commit will be called and 
   close will be executed or it will be closed without commit ?

我认为我们需要关闭会议。提交事务后,会话将关闭。但是,在这种情况下,我们只想中断查询,但要保留先前的插入或更新。

请详细帮助我。

谢谢

chlinboy 回答:什么时候DB线程被杀死-休眠会话或会话工厂结束?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3140318.html

大家都在问