1、getCurrentSession() 会绑定当前线程; openSession() 不会绑定当前线程。
2、getCurrentSession() 事务由 Spring 控制的,且不需要手动关闭;openSession() 需开发者手动开启和提交事务。
1、getCurrentSession() 会绑定当前线程; openSession() 不会绑定当前线程。
2、getCurrentSession() 事务由 Spring 控制的,且不需要手动关闭;openSession() 需开发者手动开启和提交事务。