public void flushCloseSession(Session session) { try { session.flush(); if (!session.connection().getAutoCommit()) { session.connection().commit(); } this.closeSession(session); } catch (HibernateException he) { if (log.isDebugEnabled()) { log.debug("HibernateException caught during flush/commit.", he); } } catch (SQLException sqle) { if (log.isDebugEnabled()) { log.debug("SQLException caught during commit.", sqle); } } } }