8

In Coldfusion 9 to get the application datasource outside application.cfc, I've used application.getApplicationSettings().datasource.

In Coldfusion 10 getApplicationSettings() has been replaced with ApplicationGetMetadata(). So naturally I tried ApplicationGetMetaData().datasource, but the ApplicationGetMetaData() function doesn't currently work... (see documentation and comments).

So how can I get the application datasource name (this.datasource in application.cfc) from outside the application.cfc in CF10?

1

1 Answer 1

14

There is no ColdFusion function called ApplicationGetMetaData. The correct function name is GetApplicationMetaData().

You can get the application's datasource by calling GetApplicationMetaData().datasource.

6
  • 4
    apparently the function was renamed between CF10 prerelease and the final release (bugbase.adobe.com/index.cfm?event=bug&id=3208541) The old documentation for applicationGetMetadata was still online until exactly today :)
    – jan
    Sep 28, 2012 at 14:04
  • Indeed: bit.ly/USX0UZ (the cached version of the docs page for ApplicationGetMetaData()) Sep 28, 2012 at 14:49
  • 1
    @Adam: Please don't use URL shorteners here. They're not necessary. Worse, they're often blocked by enterprise firewalls because they can be a vector for malware.
    – ale
    Sep 28, 2012 at 17:57
  • I can't help but think there might be better things to do with your time, Al, but here's the original unabridged URL: Sep 28, 2012 at 19:18
  • 1
    @Adam - I think you misread Al's comment. He is not saying you are spreading malware, just that some corporate firewalls are extremely restrictive. Ridiculously so at times. If they see a shortened url they automatically block it - no exceptions. (It does not matter that it might point to a perfectly legitimate site.) So anyone reading S.O. from behind such a firewall wouldn't be able to access the site you referenced.
    – Leigh
    Sep 28, 2012 at 20:05

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.