| We have an application using Hibernate 5.2.10.Final with Oracle 11 DB with multi-tenancy enabled using different schemas. The Oracle dialect's default Bulk ID strategy is to use GlobalTemporaryTableBulkIdStrategy, since Oracle only supports global temporary tables, not local. This GlobalTemporaryTableBulkIdStrategy creates the temporary tables inside its prepare() method. As far as I can tell, this is only called from SessionFactoryImpl<impl>:302. But here we are getting any connection from the MultiTenantConnectionProvider. The end result is that the global temporary tables are created for only one of the tenants. Since each tenant is using a different schema in our case, operations relying on the global temporary tables fail because the temp tables are missing. I expected that multi-tenancy with different schemas would work when using GlobalTemporaryTableBulkIdStrategy, given that it is the default for the Oracle dialect. The necessary global temporary tables should be created for all tenant schemas. |