mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 22:19:03 +00:00
Propagate wrapped exception in SessionFactoryUtils
Improve stack traces in certain Hibernate failure cases by properly chaining the cause exception. Issue: SPR-7933 git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4146 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+1
-1
@@ -666,7 +666,7 @@ public abstract class SessionFactoryUtils {
|
||||
return new HibernateObjectRetrievalFailureException((WrongClassException) ex);
|
||||
}
|
||||
if (ex instanceof NonUniqueResultException) {
|
||||
return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1);
|
||||
return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
|
||||
}
|
||||
if (ex instanceof StaleObjectStateException) {
|
||||
return new HibernateOptimisticLockingFailureException((StaleObjectStateException) ex);
|
||||
|
||||
+1
-1
@@ -294,7 +294,7 @@ public abstract class EntityManagerFactoryUtils {
|
||||
return new EmptyResultDataAccessException(ex.getMessage(), 1);
|
||||
}
|
||||
if (ex instanceof NonUniqueResultException) {
|
||||
return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1);
|
||||
return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
|
||||
}
|
||||
if (ex instanceof OptimisticLockException) {
|
||||
return new JpaOptimisticLockingFailureException((OptimisticLockException) ex);
|
||||
|
||||
Reference in New Issue
Block a user