How to change Hibernate schema at run time


#1

I have A requirement where the current schema to be used is stored in db table;(schema_a or schema_b).

The application is loaded with default schema spring.jpa.properties.hibernate.default_schema=schema_a Now when the data in table is updated to B I want to consider all jpa query to use schema_b without any down time at server.


#2

You can use schema-based multitenancy. Check out the User Guide for more details.