public HibernateOptimisticLockingFailureException(StaleStateException ex) { super(ex.getMessage(), ex); }
public HibernateOptimisticLockingFailureException(StaleStateException ex) { super(ex.getMessage(), ex); }
public String getMessage() { return super.getMessage() + " : " + MessageHelper.infoString( entityName, identifier ); }
protected PersistenceException wrapStaleStateException(StaleStateException e) { PersistenceException pe; if ( e instanceof StaleObjectStateException ) { final StaleObjectStateException sose = (StaleObjectStateException) e; final Serializable identifier = sose.getIdentifier(); if ( identifier != null ) { try { final Object entity = sharedSessionContract.internalLoad( sose.getEntityName(), identifier, false, true); if ( entity instanceof Serializable ) { //avoid some user errors regarding boundary crossing pe = new OptimisticLockException( e.getMessage(), e, entity ); } else { pe = new OptimisticLockException( e.getMessage(), e ); } } catch (EntityNotFoundException enfe) { pe = new OptimisticLockException( e.getMessage(), e ); } } else { pe = new OptimisticLockException( e.getMessage(), e ); } } else { pe = new OptimisticLockException( e.getMessage(), e ); } return pe; }
public HibernateOptimisticLockingFailureException(StaleStateException ex) { super(ex.getMessage(), ex); }
public HibernateOptimisticLockingFailureException(StaleStateException ex) { super(ex.getMessage(), ex); }
public HibernateOptimisticLockingFailureException(StaleStateException ex) { super(ex.getMessage(), ex); }
public String getMessage() { return super.getMessage() + ": " + MessageHelper.infoString(entityName, identifier); }
public String getMessage() { return super.getMessage() + ": " + MessageHelper.infoString(entityName, identifier); }
public String getMessage() { return super.getMessage() + ": " + MessageHelper.infoString(entityName, identifier); }
public String getMessage() { return super.getMessage() + ": " + MessageHelper.infoString(entityName, identifier); }
public String getMessage() { return super.getMessage() + " : " + MessageHelper.infoString( entityName, identifier ); }
protected PersistenceException wrapStaleStateException(StaleStateException e) { PersistenceException pe; if ( e instanceof StaleObjectStateException ) { final StaleObjectStateException sose = (StaleObjectStateException) e; final Object identifier = sose.getIdentifier(); if ( identifier != null ) { try { final Object entity = sharedSessionContract.internalLoad( sose.getEntityName(), identifier, false, true); if ( entity instanceof Serializable ) { //avoid some user errors regarding boundary crossing pe = new OptimisticLockException( e.getMessage(), e, entity ); } else { pe = new OptimisticLockException( e.getMessage(), e ); } } catch (EntityNotFoundException enfe) { pe = new OptimisticLockException( e.getMessage(), e ); } } else { pe = new OptimisticLockException( e.getMessage(), e ); } } else { pe = new OptimisticLockException( e.getMessage(), e ); } return pe; }
private static net.sf.hibernate.StaleObjectStateException adaptStaleObjectStateException( final org.hibernate.StaleStateException ex) { org.hibernate.StaleObjectStateException stex = ex instanceof org.hibernate.StaleObjectStateException ? (org.hibernate.StaleObjectStateException) ex : null; final String message = ex.getMessage(); final String entityName = stex != null ? stex.getEntityName() : null; final Serializable identifier = stex != null ? stex.getIdentifier() : null; return new net.sf.hibernate.StaleObjectStateException(null, identifier) { @Override public String getMessage() { return message; } @Override public Class getPersistentClass() { try { return entityName != null ? Class.forName(entityName) : Object.class; } catch (ClassNotFoundException ex) { return Object.class; } } @Override public String toString() { return toStringWithClassName(this, net.sf.hibernate.StaleObjectStateException.class); } }; }