File tree 1 file changed +6
-3
lines changed
spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5
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) {
48
48
if (ex instanceof HibernateException ) {
49
49
return convertHibernateAccessException ((HibernateException ) ex );
50
50
}
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 );
53
56
}
54
- return EntityManagerFactoryUtils . convertJpaAccessExceptionIfPossible ( ex ) ;
57
+ return null ;
55
58
}
56
59
57
60
/**
You can’t perform that action at this time.
0 commit comments