Updating datasource on-the fly
Hi,
We have a requirement to switch datasources in our application. A cloud app we are developing has a primary and secondary server and it will tell us when the primary is offline and it can call a end-point (.cfm) on our server. If this script updated our neo-datasources.xml on-the-fly with the new datasource information, would this change the DSN reliably? Would it require a server restart? Does it sound viable?
I suppose we could also put some code in application.cfc to check the database, but this means we have to change the DSN back again at some time in the future when the DSN for the primary starts working again, so perhaps some scheduled task etc? All sounds a bit too convoluted.
We could put a test in our .cfm code to see if the primary database was offline, but that's more code and it has to be in every request, which sounds a bad idea.
Any ideas appreciated.
Thanks,
Mark
