• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate - Database IP changes daily

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Where does a nanny get ground to air missles? Protect this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic