title: Change database schema of entitymanager during runtime based on logged in user
body: <p>I have read many questions and answers about dynamic implementation of <code>EntityManager</code> with different schemas. I found also a solution using alter database session to set current schema (see below). 
  <code>ALTER SESSION SET CURRENT_SCHEMA= "SCHEMA_NAME"</code></p>
  
  <p>As the number of users using the application increases, this isn't a suitable way of routing anymore. Also, it would change to <code>EntityManager</code> on every time a new user login. The situation is as follows</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I'm using Spring with Hibernate 4.0 and Spring data JPA</p>
  
  <p>I can't find a way to change the schema completely dynamically. Does someone know how to do it in spring?</p>