Copy link to clipboard
Copied
Hello, thanks for looking..
I have two datasources configured on a production web server (Win IIS, CF8), one that connects to a remote database and the other connects to a local database. A web application I was in the process of migrating to a new server used the datasource that connected to the remote database as I was taking one step at a time. Yesterday became the day to make the final jump and to migrate the database, so after comparing the two databases (SQL Delta is a beautiful tool), I proceded to swap the datasources by renaming them in the ColdFusion Administrator. I renamed the datasource to the remote database to some arbitrary backup name, then renamed the datasource to the local database to the original name of the the datasource to the remote database.
JDBC, ODBC, whatever, I have probably performed these same steps hundreds of times without an issue. Yesterday, after renaming the datasource, verifying it, confirming it was working by browsing the application and seeing the noticable performance increase from accessing a local database, I was content to call to process complete.
At 3am server time however, the application began throwing errors, saying the datasource could not be found. I jumped into CF Admin to check everything out and found things just as I left them, two datasources, one named as a backup and the other the original name to the local database. When I clicked verify all however, the datasource to the local database failed, saying "Datasource could not be found".
I am curious as to what may have happened here. I don't see any cause for alarm with regards to technique as I have been using it for so long. ColdFusion server.log shows no sign of a restart. Does anyone have any clue what could have happened here? How could a datasource appear in CF Admin, yet verifying it says it doesn't exist? I resolved the problem by renaming it to something else, then renaming it back but I plan on deleting and recreating it completely this evening when traffic is lower. My only guess here is that ColdFusion updated active memory but failed when updating the registry, then something happened where things were refreshed.. But why.. and how can that be detected/avoided if true?
I have a lot of people asking me questions now, and after spending great amount of time convincing them ColdFusion is the best answer for their needs the first time around, I am having trouble doing so this second time. So thank you in advance for any help or insight..
Mike
Copy link to clipboard
Copied
To be honest, I'd probably not dwell on the "why", and just delete @ recreate the DSN.
--
Adam
Copy link to clipboard
Copied
I am okay with that, and a 1 in 200ish failure rate, especially now that I have an automated script verifying datasources regularly. My clients are not however, especially without understanding the cause. Thanks for the reply though.
Copy link to clipboard
Copied
I am okay with that, and a 1 in 200ish failure rate, especially now that I have an automated script verifying datasources regularly. My clients are not however, especially without understanding the cause. Thanks for the reply though.
Well, if that client was mine, I'd be saying something along these lines:
"I've investigated this as much as practical, and asked around the CF community, and no-one has heard of this happening. Given it's an isolated occurrence, I'm prepared to put this down to a temporary aberration, which is now resolved. "Case closed", although obviously we'll "watch this space" too. All computer software is very complex, and there will always be glitches. I can investigate this to conclusion if you like, but it's difficult to troubleshoot something after havnig fixed it, especially when it's not replicable. I am satisfied this is not something to be concerned about, however if you really want me to get to the bottom of it, it's likely to take a week (billable, as it's not a good use of my time), and at the end of it, you're not going to be any better off. If it's such a concern - and fair enough - that there's a single point of failure here, then let's start talking about some fail-over protection. That way if any other aberrations present themselves, it will not be an issue".
However, in the mean time, have a look at your JRun and CF logs at round about the time the problem happened, and see if there's anything in there to do with JDBC and the like.
--
Adam
Copy link to clipboard
Copied
I am curious as to what may have happened here. I don't see any cause for alarm with regards to technique as I have been using it for so long. ColdFusion server.log shows no sign of a restart. Does anyone have any clue what could have happened here? How could a datasource appear in CF Admin, yet verifying it says it doesn't exist? I resolved the problem by renaming it to something else, then renaming it back but I plan on deleting and recreating it completely this evening when traffic is lower. My only guess here is that ColdFusion updated active memory but failed when updating the registry, then something happened where things were refreshed.. But why.. and how can that be detected/avoided if true?
My guess is that something went wrong when CF Admin was busy. To set datasources, CF Admin has to instantiate components and invoke methods, just like any ordinary component that you and I may write. See the examples in the following page
Coldfusion Administrator AdminAPI
The more settings you change in CF Admin, the higher the chance that a component instance fails to update, that a function call hangs, and so on. Fortunately, such occurrences are rare.
Copy link to clipboard
Copied
Which backups and other scheduled processes run at 3 AM?