HHH-8032 OptimisticLockException with message of the wrapped

StaleObjectStateException

Conflicts:
	hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractEntityManagerImpl.java
This commit is contained in:
Juergen Zimmermann 2013-10-15 14:41:34 -04:00 committed by Brett Meyer
parent f7b80fb28c
commit 3d932aeb33
1 changed files with 5 additions and 5 deletions

View File

@ -1410,22 +1410,22 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
Object entity = getRawSession().load( sose.getEntityName(), identifier );
if ( entity instanceof Serializable ) {
//avoid some user errors regarding boundary crossing
pe = new OptimisticLockException( null, e, entity );
pe = new OptimisticLockException( e.getMessage(), e, entity );
}
else {
pe = new OptimisticLockException( e );
pe = new OptimisticLockException( e.getMessage(), e );
}
}
catch ( EntityNotFoundException enfe ) {
pe = new OptimisticLockException( e );
pe = new OptimisticLockException( e.getMessage(), e );
}
}
else {
pe = new OptimisticLockException( e );
pe = new OptimisticLockException( e.getMessage(), e );
}
}
else {
pe = new OptimisticLockException( e );
pe = new OptimisticLockException( e.getMessage(), e );
}
return pe;
}