Is it a good practice to open up a connection on every request and close it after that?
No this is not good practice.see this with Hibernate use connection pooling
There is a single sessionfactory which opens up the sessions for each request, What is the correlation of it with Connection?
Hibernate uses the connection pool when we get the session
from SessoinFactory
from one of the connections are allocated to session
When should open up and close a connection
With hibernate you don't worry about the JDBC Connection
as long as you are thinking about the performance
when should we just open up a session and close it
For all the CRUD operations
Is it like, we should open a new connection on every login and close that connection on logout or hibernate does it itself?
No User login and JDBC Connection
has no relation