} catch (final HibernateSystemException hse) {
LOGGER.error(hse.getMessage());
} catch (final DataAccessException dae) {
final Throwable cause = dae.getCause();
if (cause.getClass().equals(org.hibernate.StaleStateException.class)) {
throw new JournalException(Messages.Error.IAE_GENERIC, Messages.Error.IAE_INV_UPDATE,
cause.getMessage(), dae);
} else if (cause.getClass().equals(PropertyValueException.class)) {
throw new JournalException(cause.getMessage(), cause); // NOPMD by r39
} else if (cause.getClass().equals(TransientObjectException.class)) {
throw new JournalException(Messages.Error.JE_UNSVD_ROBJ_ERR, cause); // NOPMD by
} else {
final String errorMsg = ((SQLException) dae.getCause().getCause()).getMessage();
throw new JournalException(errorMsg, dae);
}
} catch (final Exception e) {
throw new JournalException(e.getMessage(), e);
}
}