openSession()和getCureentSession()的区别

openSession():永远是打开一个新的session

getCureentSession():如果当前环境有session,则取得原来已经存在的session,如果没有,则创建一个新的session

session commit后,原来的session就消失了。

原文地址:https://www.cnblogs.com/toSeeMyDream/p/5537803.html