File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5 Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,13 @@ public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
4848 if (ex instanceof HibernateException ) {
4949 return convertHibernateAccessException ((HibernateException ) ex );
5050 }
51- if (ex instanceof PersistenceException && ex .getCause () instanceof HibernateException ) {
52- return convertHibernateAccessException ((HibernateException ) ex .getCause ());
51+ if (ex instanceof PersistenceException ) {
52+ if (ex .getCause () instanceof HibernateException ) {
53+ return convertHibernateAccessException ((HibernateException ) ex .getCause ());
54+ }
55+ return EntityManagerFactoryUtils .convertJpaAccessExceptionIfPossible (ex );
5356 }
54- return EntityManagerFactoryUtils . convertJpaAccessExceptionIfPossible ( ex ) ;
57+ return null ;
5558 }
5659
5760 /**
You can’t perform that action at this time.
0 commit comments