From cbfa233ea1c54d63e7d5f0292e54071cf80b0813 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Mon, 15 Apr 2013 14:50:43 -0500 Subject: [PATCH] HHH-7880 - SessionFactory.openStatelessSession() does not respect tenant identifier from CurrentTenantIdentifierResolver --- .../main/java/org/hibernate/internal/SessionFactoryImpl.java | 4 ++++ 1 file changed, 4 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 3f5549efd8..45b2529fa1 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -1626,6 +1626,10 @@ public final class SessionFactoryImpl public StatelessSessionBuilderImpl(SessionFactoryImpl sessionFactory) { this.sessionFactory = sessionFactory; + + if ( sessionFactory.getCurrentTenantIdentifierResolver() != null ) { + tenantIdentifier = sessionFactory.getCurrentTenantIdentifierResolver().resolveCurrentTenantIdentifier(); + } } @Override