1

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?

Julien Rousé
  • 1,115
  • 1
  • 15
  • 30
Premsj
  • 11
  • 2
  • 1
    You might want to take a look at https://dzone.com/articles/spring-boot-hibernate-multitenancy-implementation – crizzis Jan 25 '18 at 12:01

0 Answers0