Hello, I’m trying to setup a multi tenant app on glassfish 7.0.10 and Mysql 8 with hibernate, I defined a SchemaMultiTenantConnectionProvider and the tenant context, I’m using a separate schemas and when 2 or more schemas (customers) are using the app the information from one schema ends up in the other schemas view.
The getConnection method on the provider changes the schema
Connection myDSConnection = myDS.getConnection();
myDSConnection.setSchema(s.toLowerCase(Locale.ROOT));
myDSConnection.createStatement().execute(String.format("USE %s;", s.toLowerCase(Locale.ROOT)));
I can’t figure out why its doing this, as there are no errors in the log. I tried the glassfish pool the mysql jdbc pool and I still have the same problem.
I don’t know if its a bug in hibernate or the glassfish/mysql pool
Has anyone run into this problem or have any suggestions ?