From this link:
http://www.hibernate.org/43.html, I read the following:
Using an interceptor
Line 1 -
If you implement your Session handling with Hibernates built-in support for automatic Session context management, see Sessions and transactions, you have half of the code for this already. Now you only need some kind of
interceptor that
runs after the view has been rendered, and that will then commit the database transaction, hence close the Session.
Line 2 -
In other words, in most applications you need the following: when an HTTP request has to be handled, a new Session and database transaction will begin.
Right before the response is send to the client, and after all the work has been done, the transaction will be committed, and the Session will be closed.
These lines
contradict each other. One says, interceptor runs 'session closed
after the view has been rendered'. Second says 'session closed
before the response sent to the client'.
Can someone please explain this to me.
Thank you.