0
我是hibernate的新手,我在使用getCurrentSession()和openSession()檢索會話時有點困惑,許多文章都提到getCurrentSession會創建一個全新的會話,尚未存在,並且如果會話已經可用,則不會創建新會話,另一方面,openSession會創建一個全新的會話。在休眠中使用getCurrentSession()和openSession()檢索會話
- 在這裏,我有一個混淆確實openSession()總是創建一個全新的會話?
- 休眠池會話是否在getCurrentSession()中使用相同的會話?
能否請你幫我澄清這一點,並表示歉意我沒有犯錯
非常感謝