Disconnect the
Session from the current JDBC connection. If the connection was obtained by Hibernate close it and return it to the connection pool; otherwise, return it to the application.
This is used by applications which supply JDBC connections to Hibernate and which require long-sessions (or long-conversations)
Note that disconnect() called on a session where the connection was retrieved by Hibernate through its configured {@link org.hibernate.connection.ConnectionProvider} has no effect,provided {@link ConnectionReleaseMode#ON_CLOSE} is not in effect.
@return the application-supplied connection or
null
@see #reconnect(Connection)
@see #reconnect()