I have a question related to Hibernate Connection, Session and SessionFactory. The queries are as below:
1) Is it a good practice to open up a connection on every request and close it after that?
2) There is a single sessionfactory which opens up the sessions for each request, What is the correlation of it with Connection? I know that on connection the sessionfactory opens sessions for different requests, When should open up and close a connection and when should we just open up a session and close it? Is it like, we should open a new connection on every login and close that connection on logout or hibernate does it itself?
Thanks in advance for your kind review
Regards Rahul