就hibernate而言,JTA,JPA和Plain JDBC有什么区别?
我正在用hibernate和jsp/servlet编写一个基于Web的应用程序.我已经阅读了有关方法sessionFactory.getCurrentSession和sessionFactory.openSession方法.我知道它们之间的基本区别(使用getCurrentSession您不必关闭连接,当您提交事务时,您的会话将自动关闭).根据我的理解,我们应该选择getCurrentSession并通过每个请求进行会话.
让我们考虑以下场景:
getCurrentSession并获取当前会话getCurrentSession并启动事务现在我的问题是