From d6a3fdb771cc35e8655181bf1aded8b29e793c2e Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Sat, 30 Apr 2016 19:56:52 +0100 Subject: [PATCH] Fix EntityManagerFactoryClosedTest --- .../main/java/org/hibernate/internal/SessionFactoryImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java index be90537b86..fa8e367eab 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -544,6 +544,7 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor { } private Session buildEntityManager(SynchronizationType synchronizationType, Map map) { + validateNotClosed(); SessionBuilderImplementor builder = withOptions(); if ( synchronizationType == SynchronizationType.SYNCHRONIZED ) { builder.autoJoinTransactions( true ); @@ -594,6 +595,7 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor { @Override public CriteriaBuilder getCriteriaBuilder() { + validateNotClosed(); return criteriaBuilder; } @@ -739,6 +741,7 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor { } public CacheImplementor getCache() { + validateNotClosed(); return cacheAccess; }