throw new AssertException("Try to close un-committed session");
}
hibernateSession.close();
}
} catch (HibernateException e) {
throw new DBRuntimeException("Close Session error.", e);
} catch (Exception e) {
throw new DBRuntimeException("Error in dbsession.close: ", e);
} finally {
try {
if (hibernateSession != null) {
if (hibernateSession.isOpen()) hibernateSession.close();
}
} catch (Exception e) {
// we did our best to close the hibernate session
throw new DBRuntimeException("in finally of DBSession.java / closeSession(), closesession failed again ", e);
}
}
}