Simple answer: Do not use session.connection.close.
Explanation: That will close the JDBC link itself. That means your application is getting itself involved in managing the JDBC links. That is not right. Whatever container you are running in will handle that for you. For example, Tomcat manages its own pools. If you nuke connections by yourself, that disrupts whatever Tomcat is doing. I don't know if that will actually cause failures but it will degrade the performance of Tomcat's pooling.
The only exception to this is if you have created the session by providing it with a JDBC connection, like this:
Code:
session = sessionFactory.openSession(myJdbcConnection);
which is rarely-used. You might use that in a stand-alone application, maybe, but it's rare.
So, no, do not call session.connection.close.