Hibernate:JSP 應用程式中的openSession() 與getCurrentSession()
在使用Hibernate 的Web 應用程式中,會出現一些有關會話管理的問題。以下是一些常見問題及其相應的答案。
1. hibernate.current_session_context_class Value
要使用目前會話策略啟用自動會話管理,請將 hibernate.current_session_context_class 設定屬性設定為 thread。
2。 openSession() 與 getCurrentSession()
3.每個Web 應用程式一個會話與每個請求一個會話
以上是JSP 應用程式中的 Hibernate:`openSession()` 與 `getCurrentSession()` - 我應該使用哪一個?的詳細內容。更多資訊請關注PHP中文網其他相關文章!