java - JPA/Hibernate - Is it safe to change the connection whilst serving a request? -


i using jpa2/hibernate 5 in project. have enabled multi-schema support. within web-application every time new user created, schema created user by:

 connection.createstatement().execute("create schema " + tenantidentifier + "");         connection.createstatement().execute("use " + tenantidentifier + "");         schemaexport export = new schemaexport(                 (metadataimplementor) metadatasources.buildmetadata(),                 connection);         export.create(true, true); 

if 2 web requests made @ same time, 1 created new schema , tried fetch data different schema, data access issue happen or connection object session using created per request? db interactions handled spring's jpa repositories. using spring boot


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -