RE: [coldbox:16617] [coldbox 3.1.0 - newbie] database connection issue

It seems incredibly unlikely that the actual data source name in the ColdBox data source setting would change after the application was initialized unless there is code in the app somewhere changing that setting. The settings and environment overrides are only processed once when the framework starts up and then live in memory. Now, if you were also reinitting the framework with ?fwreinit=1 then it is possible that something funky could be happening.

Since you’ve said that the only steps necessary for you to reproduce this problem are to restart your database (correct me if you’re doing more than that) then it sounds like nothing is being reloaded in ColdBox at that time.

You said the data source name was hard-coded into logger. That sounds like a very promising lead for you to explore. Based on the log levels of the appender and the categories using that appender, you will quite possibly find that the appender is only used when errors occur to log them. If you are restarting your database, that would be a prime time for code to begin erroring and then start invoking your logger to log the error. Check out a stack trace to see what code is running when the incorrect data source is referenced.

What I can’t tell you, is what data source that logger should be using since I don’t know anything about your set up. Remember, you can override LogBox settings in your environment overrides as well if you need the logBox data source to be different on your production servers.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

Thank you Brad. When I get it pin pointed I will follow up on this.


One more step forward.

It appears to be a problem with the way the environment configuration was set up. In the coldbox.cfc full domain names were used… so the test environment was and the production environment was Even though the application is on it seems to be selecting the production environment. Perhaps it wildcards the dots?

I believe if I update it to use ^test. for the test environment and default to production that that will take care of the problem.