HHH-8032 OptimisticLockException with message of the wrapped StaleObjectStateException

This commit is contained in:
Juergen Zimmermann 2013-10-07 15:48:38 +02:00 committed by Brett Meyer
parent 716db5d116
commit 1e42894fa7
1 changed files with 5 additions and 5 deletions

View File

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