HibernateExceptionTranslator avoids JPA IllegalState/ArgumentException translation
Issue: SPR-14681
This commit is contained in:
parent
480cd2c2f0
commit
34ab818dfa
|
|
@ -48,10 +48,13 @@ public class HibernateExceptionTranslator implements PersistenceExceptionTransla
|
|||
if (ex instanceof HibernateException) {
|
||||
return convertHibernateAccessException((HibernateException) ex);
|
||||
}
|
||||
if (ex instanceof PersistenceException && ex.getCause() instanceof HibernateException) {
|
||||
return convertHibernateAccessException((HibernateException) ex.getCause());
|
||||
if (ex instanceof PersistenceException) {
|
||||
if (ex.getCause() instanceof HibernateException) {
|
||||
return convertHibernateAccessException((HibernateException) ex.getCause());
|
||||
}
|
||||
return EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(ex);
|
||||
}
|
||||
return EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(ex);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue