A reader sent me a question and wanted to know why something wasn't working. In the ColdBox config we have the following setting. Then in your model you have 2 ways that you can access this datasource object both of which work off of the alias. The alias is the left side of the assignment in our settings here so in our case mysite is the datasource alias. We can wire up the property using wirebox and the correct dsl coldbox:datasource:alias The easier way is to use the ColdBox Model Integration features and use the shortcut. Then in your code you can access the name in a query by using getName()
What happend in the case of our reader is he might of got the wrong idea about alias. In his code he had the following datasource setting. And when he was trying to wire up the datasource object he was using the following which will end up throwing a dsn is not defined error when you trying accessing the object.

#1 by Bummed Out on 12/8/11 - 5:47 PM
I've set up the datasources section in ColdBox.cfc, autowiring is enabled, and I'm using the cfproperty tag in my model as such: <cfproperty name="dsn" inject="coldbox:datasource:primary" scope="variables" /> where "primary" is the alias to my datasource. I've tried changing the scope to instance, and also removing the scope attribute. I've tried referring to the dsn variable as "#instance.dsn#", "#variables.dsn#", just plain "#dsn#" - all of them always cause the undefined variable error.
Is there somewhere else I should be looking. I've been at this for around 6 hours now and don't think I can stomach looking through the ColdBox documents 1 more time.
Thanks in advance for any suggestions.