0
votes

I have set up a Data Source in the ColdFusion Admin panel. When I try and use this in the application, I get the error: Datasource [name] could not be found. I have verified that the Data Source Name I am using in the application is identical to that which was set up in the admin panel (multiple tries both manual typing and ctr+a + ctr+c) with no luck.

What I have tried:

  • Clearing the cache (component and template)
  • I have even tried different names in the DSN (admin panel) and none seem to work.

Any guidance?

EDIT

There are 3 running instances. None of which have an admin panel that loads(ERR_CONNECTION_RESET). Verbatim error message:

The web site you are accessing has experienced an unexpected error. Please contact the website administrator.

The following information is meant for the website developer for debugging purposes. Error Occurred While Processing Request Datasource test could not be found."

Related code that is throwing the error:

<cfset Application.datasource = "test">
<cfinclude template="templates/header.cfm">
<cfinclude template="templates/horizontal_navigation.cfm">
<cfquery name="getUsers" datasource="#application.datasource#">
    select *
    from role_lookup rl
2
What does your code look like? Is that the actual error message? - Matt Busche
How many instances of ColdFusion are you running? - Dan Bracuk
When you entered the DSN originally. Did you make sure there was no space at the end? Also, what version of CF are you using? - fyroc
Yeah, sounds to me like the CFAdmin screen you're looking at is not the one for the CF instance you're running your code on. - Adam Cameron
@CoryFail its Coldfusion 9. I have verified no spaces just the word 'test' in the DSN - darkwisperer

2 Answers

2
votes

I was under the impression that ColdFusion instances were isolated. Which seems true between apps, however the parent that spawned the instances "seems" to be allowing data source inheritance.

The issue was caused by having an identically named data source in the parent instance. The parent instance will override data sources of the same name, so when the parent data source of the same name was not pointed at a valid database it threw those errors.

I have not been able to find anything about this through research, so it might have been a coincidence and something else I changed around the same time could have been the actual issue.

-1
votes

attributes.datasource can work to when passing variables