mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
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:
parent
f7b80fb28c
commit
3d932aeb33
@ -1410,22 +1410,22 @@ public PersistenceException wrapStaleStateException(StaleStateException e) {
|
|||||||
Object entity = getRawSession().load( sose.getEntityName(), identifier );
|
Object entity = getRawSession().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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user