List of usage examples for javax.persistence OptimisticLockException getMessage
public String getMessage()
From source file:se.nrm.dina.data.jpa.impl.DinaDaoImpl.java
@Override public T merge(T entity) { logger.info("merge: {}", entity); T tmp = entity;//from ww w.j a v a 2s. co m try { tmp = entityManager.merge(entity); entityManager.flush(); // this one used for throwing OptimisticLockException if method called with web service // entityManager.clear(); } catch (OptimisticLockException e) { logger.warn(e.getMessage()); } catch (ConstraintViolationException e) { logger.warn(e.getMessage()); throw new DinaException(handleConstraintViolation(e)); } catch (Exception e) { logger.warn(e.getMessage()); } return tmp; }