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

Hibernate - Database IP changes daily

 
Kim Lilienfeld
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm currently in the situation where I am writing an app for a client whose current database changes IP daily. Basically, they have 2 databases of identical structure but all their data is obtained from an import provided by another company (due to security restrictions they can't access the source database). In order to prevent the situation of having no data for a day if the import fails, they have set up the 2 databases on 2 servers which they work from. There is a separate constant database which holds the ip of the current database.

Now I am developing an app for them using Hibernate as the persistence layer but have no idea how to set it up so Hibernate is always pointing to the correct database. Does anyone have any idea how I can configure this and then reload hibernate's configuration every day (or even every hour if necessary) to point to the latest database.

Any help/ideas would be appreciated.

Thanks,
Kim
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well anything that you configure in the xml files you can also configure programatically. So in code then you can do some logic that figures out the IP for the day, then programatically set that up in the Configuration object.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic