From 29d5b417004c07e50df29c23a0d8abb52f934104 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Wed, 22 Nov 2017 15:27:45 -0600 Subject: [PATCH] HHH-12101 - Make sure Hibernate returns null on failed attempt to create EMF --- .../org/hibernate/jpa/HibernatePersistenceProvider.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java b/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java index cfbefbc7cd..3e4831ebfc 100755 --- a/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java @@ -58,13 +58,11 @@ public class HibernatePersistenceProvider implements PersistenceProvider { return builder.build(); } } - catch (PersistenceException pe) { - throw pe; - } catch (Exception e) { - log.debug( "Unable to build entity manager factory", e ); - throw new PersistenceException( "Unable to build entity manager factory", e ); + log.debug( "Unable to create EntityManagerFactory", e ); } + + return null; } protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilderOrNull(String persistenceUnitName, Map properties) {