session.getTransaction().commit();
} catch (Exception ex) {
log.error(ex);
if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
throw new StoreInternalException(ex, "Cannot access database.");
}
// done
log.trace("Done.");