I have read many questions and answers about dynamic implementation of EntityManager
with different schemas. I found also a solution using alter database session to set current schema (see below).
ALTER SESSION SET CURRENT_SCHEMA= "SCHEMA_NAME"
As the number of users using the application increases, this isn't a suitable way of routing anymore. Also, it would change to EntityManager
on every time a new user login. The situation is as follows
1 database server
many schemas on that server, every user has their own schema.
I only need to change the schema name during runtime the schema name is retainable by logged in user
I'm using Spring with Hibernate 4.0 and Spring data JPA
I can't find a way to change the schema completely dynamically. Does someone know how to do it in spring?