2

I'm new to hibernate. In my web application, users after login have to point to different schema (with same tables) on the same postgres database to make queries.

Is there a method to specify at runtime the schema name, that i have in session ?

Many thanks.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
  • possible duplicate of [Hibernate and Multi-Tenant Database using Schemas in PostgreSQL](http://stackoverflow.com/questions/8349267/hibernate-and-multi-tenant-database-using-schemas-in-postgresql) – Craig Ringer Jun 28 '13 at 13:22
  • Did you search first? Looks like it's already been covered. – Craig Ringer Jun 28 '13 at 13:22
  • Thank you, I haven't finded this discussion, then the easiest method is, before each query, set the search path? But is good in term of performance with many queries? – user2183185 Jun 28 '13 at 14:05
  • and so I should instantiate an hibernate session for each schema ... I can somehow pass the schema parameter when executing the query using the same session? – user2183185 Jun 28 '13 at 15:30

0 Answers0