diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateExceptionTranslator.java b/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateExceptionTranslator.java index 96c0c26e76..fc247d49f5 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateExceptionTranslator.java +++ b/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateExceptionTranslator.java @@ -94,7 +94,7 @@ public class HibernateExceptionTranslator implements PersistenceExceptionTransla DataAccessException dae = this.jdbcExceptionTranslator.translate( "Hibernate operation: " + jdbcEx.getMessage(), jdbcEx.getSQL(), jdbcEx.getSQLException()); if (dae != null) { - throw dae; + return dae; } } return SessionFactoryUtils.convertHibernateAccessException(ex); diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java b/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java index ea1c8026d2..5ece030b1d 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java +++ b/spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java @@ -784,8 +784,6 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana /** * Convert the given HibernateException to an appropriate exception * from the {@code org.springframework.dao} hierarchy. - *

Will automatically apply a specified SQLExceptionTranslator to a - * Hibernate JDBCException, else rely on Hibernate's default translation. * @param ex the HibernateException that occurred * @return a corresponding DataAccessException * @see SessionFactoryUtils#convertHibernateAccessException