SessionFactory.openStatelessSession() does not respect tenant identifier from CurrentTenantIdentifierResolver

Description

When you open StatelessSession on a SessionFactory with configured multitenancy, the session does not respect current tenant identifier supplied by CurrentTenantIdentifierResolver.

Instead an exception is thrown:
org.hibernate.HibernateException: SessionFactory configured for multi-tenancy, but no tenant identifier specified

This also affects MassIndexer in Hibernate Search.

Environment

Hibernate ORM 4.1.7, MySQL 5.5

Status

Assignee

Steve Ebersole

Reporter

Zdenek Bzoch

Fix versions

Labels

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure