What's the default hibernate session control behavior in spring?
I have a 3 layer application using spring and hibernate (controller -> service -> dao) and transaction is applied to service layer. I don't configure OpenSess开发者_C百科ionInViewInterceptor or OpenSessionInViewFilter and I want to know the hibernate session control behavior. Open session per transaction or per request? Thanks!
If you're using the HibernateTransactionManager
, a Session
will get bound to the current thread and flushed and closed when the transaction ends, either through commit or roll back.
See also
- 10. Transaction management
精彩评论