agave-common/common-core/src/main/java/org/iplantc/service/common/persistence/HibernateUtil.java
/**
	 * Disconnect and return Session from current Thread.
	 *
	 * @return Session the disconnected Session
	 */
Disconnect and return Session from current Thread.
@return Session the disconnected Session
Disconnect and return Session from current Thread . @return Session the disconnected Session
public static Session disconnectSession()
		throws PersistenceException {
		Session session = getSession();
		try {
			threadSession.set(null);
			if (session.isConnected() && session.isOpen())
				session.disconnect();
		} catch (HibernateException ex) {
			throw new PersistenceException(ex);
		}
		return session;
	}
public static Session disconnectSession ( ) throws PersistenceException { Session session = getSession ( ) ; try { threadSession . set ( null ) ; if ( session . isConnected ( ) && session . isOpen ( ) ) session . disconnect ( ) ; } catch ( HibernateException ex ) { throw new PersistenceException ( ex ) ; } return session ; }
Disconnect and return Session from current Thread.
Disconnect and return Session from current Thread .