Fix EntityManagerFactoryClosedTest

This commit is contained in:
Andrea Boriero 2016-04-30 19:56:52 +01:00 committed by Steve Ebersole
parent fd7ada315e
commit d6a3fdb771
1 changed files with 3 additions and 0 deletions

View File

@ -544,6 +544,7 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor {
} }
private Session buildEntityManager(SynchronizationType synchronizationType, Map map) { private Session buildEntityManager(SynchronizationType synchronizationType, Map map) {
validateNotClosed();
SessionBuilderImplementor builder = withOptions(); SessionBuilderImplementor builder = withOptions();
if ( synchronizationType == SynchronizationType.SYNCHRONIZED ) { if ( synchronizationType == SynchronizationType.SYNCHRONIZED ) {
builder.autoJoinTransactions( true ); builder.autoJoinTransactions( true );
@ -594,6 +595,7 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor {
@Override @Override
public CriteriaBuilder getCriteriaBuilder() { public CriteriaBuilder getCriteriaBuilder() {
validateNotClosed();
return criteriaBuilder; return criteriaBuilder;
} }
@ -739,6 +741,7 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor {
} }
public CacheImplementor getCache() { public CacheImplementor getCache() {
validateNotClosed();
return cacheAccess; return cacheAccess;
} }