提交 34ab818d 编写于 作者: J Juergen Hoeller

HibernateExceptionTranslator avoids JPA IllegalState/ArgumentException translation

Issue: SPR-14681
上级 480cd2c2
......@@ -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;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册