I have been able to reproduce reported exception. You are missing the configuration of hibernate.multi_tenant_connection_provider property. Refer to documentation sections "16.3. Multi-tenancy in Hibernate" (Additionally, a MultiTenantConnectionProvider must be specified.) and "16.3.1. MultiTenantConnectionProvider" (http://docs.jboss.org/hibernate/core/4.3/devguide/en-US/html/ch16.html#d5e4722). There is already a test case covering reported scenario: https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/test/java/org/hibernate/test/multitenancy/schema/SchemaBasedMultiTenancyTest.java. I will submit pull request validating such misconfiguration and raising an exception.
|