Starting from Hibernate 5.4.5
Persistence.createEntityManagerFactory("testPU") fails, if testPU configured in persistence.xml & CurrentTenantIdentifierResolver is not null.
https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java#L382 → When Session factory created, this withOptions() called by default, same applies for HibernatePersistanceProvider.createEntityManagerFactory method, which also calls same constructor via SessionFactoryBuilderImpl.build & try to resolve the current tenant. Problem is, my implementation, and probably many others as well, uses some runtime created, request/thread specific objects, like current request or ThreadLocal values etc, to determine the current tenant.
I confirm that it’s working in 5.3. In fact, line 382 added in 5.4.5, which causes the issue.
Running tests fails, since it's using Hibernate > 5.4.4 & you can see that it's calling TenantResolver. Change the Hibernate version to 5.4.4 or lower or 5.3.X, test passes.
There’s another issue, opened about a year ago & closed without a proper fix →
any update on this issue??
any other way to get some interest to this ticket?