From 2253fad19dfa0238e81640a16c72fa256767466f Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Mon, 18 Jun 2018 15:37:40 +0100 Subject: [PATCH] HHH-12247 Propagate bootstrapping exceptions rather than logging them at DEBUG level --- .../jpa/HibernatePersistenceProvider.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 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 3e4831ebfc..dd76d47647 100755 --- a/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java @@ -47,22 +47,14 @@ public class HibernatePersistenceProvider implements PersistenceProvider { @Override public EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, Map properties) { log.tracef( "Starting createEntityManagerFactory for persistenceUnitName %s", persistenceUnitName ); - - try { - final EntityManagerFactoryBuilder builder = getEntityManagerFactoryBuilderOrNull( persistenceUnitName, properties ); - if ( builder == null ) { - log.trace( "Could not obtain matching EntityManagerFactoryBuilder, returning null" ); - return null; - } - else { - return builder.build(); - } + final EntityManagerFactoryBuilder builder = getEntityManagerFactoryBuilderOrNull( persistenceUnitName, properties ); + if ( builder == null ) { + log.trace( "Could not obtain matching EntityManagerFactoryBuilder, returning null" ); + return null; } - catch (Exception e) { - log.debug( "Unable to create EntityManagerFactory", e ); + else { + return builder.build(); } - - return null; } protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilderOrNull(String persistenceUnitName, Map properties) {