Code example for Session

Methods: close

0
	 * @see org.hibernate.Session#close() 
	 */ 
	public static void closeSession(Session session) {
		if (session != null) {
			try { 
				session.close();
			} 
			catch (HibernateException ex) {
				logger.debug("Could not close Hibernate Session", ex);
			} 
			catch (Throwable ex) {
				logger.debug("Unexpected exception on closing Hibernate Session", ex);
			} 
		} 
	} 
 
	/** 
	 * Convert the given HibernateException to an appropriate exception 
	 * from the {@code org.springframework.dao} hierarchy. 
	 * @param ex HibernateException that occurred