Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what’s the best practice to config Hibernate-Spring for multiple database relationship?

 
Kamila Rutkowski
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a main mysql database which all of the applications within our organization need the data within this database. How can I config my java web application to use this database with it's specific database when I use Spring and Hibernate within my application? How can I config JPA annotations for example between CONTRACT table within my database and COUNTRY table within our main database? what's the best practice to do this?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, you're querying two separate databases? This is a non-standard problem, I'd say. It's a little outside of the box.

Take a look at Hibernate Shards at hibernate.org. It's a new project, but it deals with mapping to multiple databases.
 
Christian Dillinger
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Under Oracle (I think other vendors might have some related features) you could create a database link between those instances and your app does not need to know both systems.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic