Forums Register Login

Hibernate - Database IP changes daily

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
We don't have time for this. We've gotta save the moon! Or check this out:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1181 times.
Similar Threads
advise regarding putting the data in application scope
ip addresses
Is Hibernate is DB dependent or Independent?
How to backuping data by using Hibernate?..
Configuring for testing
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:11:23.