I have a 3 layer application using spring and hibernate (controller -> service -> dao) and transaction is applied to service layer. I don’t configure OpenSessionInViewInterceptor or OpenSessionInViewFilter and I want to know the hibernate session control behavior. Open session per transaction or per request? Thanks!
I have a 3 layer application using spring and hibernate (controller -> service ->
Share
If you’re using the
HibernateTransactionManager, aSessionwill get bound to the current thread and flushed and closed when the transaction ends, either through commit or roll back.See also