• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate Tips: multitenancy and heterogeneous databases?  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I use Hibernate (with JPA) on a database strategy multitenancy. Each tenant has his own data in a separate datasource,  which could be just amother schema on the same database or a schema located on a separate database.
Is it possible to use a particular dialect per datasource?  This would enable the use of an Oracle datasource and a PostgreSQL datasource at the same time? This could be an interesting commercial option if possible.
Of course,  native queries should not use any database specific functions if we want this setup.

Thanks for your tip.

Regards,
Nadeem
 
Sheriff
Posts: 21136
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible if each data source gets its own persistence unit, which in turns gets its own dialect.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!