This did not solve my issue. At the time of creation of the session factory, my tenant resolver is set, but there is no tenant yet. This causes an exception. {{java.lang.IllegalArgumentException: Expected tenant identifier to be set but was not! at com.masabi.payments.dropwizard.hibernate.setup.TenantResolver.resolveCurrentTenantIdentifier(TenantResolver.java:19) at org.hibernate.internal.SessionFactoryImpl$SessionBuilderImpl.<init>(SessionFactoryImpl.java:1203) at org.hibernate.internal.SessionFactoryImpl.withOptions(SessionFactoryImpl.java:519) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:382) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)}} I don’t expect to have to provide a tenant until I want to read or write using the session. |