Random Friday Railo tip: this.datasource

Andy Jarret recently blogged about the usage of this.datasource in Application.cfc. Just goes to show, it pays off reading the patch notes sometimes because it has been there for awhile ( since version 3.1.0.018 ):

[000059] add support for default datasource to cfapplication/application.cfc
Go visit Andy's blog post for more details on how to use this.application. :) Another brief note is that this may be changing slightly in the future, but will always support the ACF Style ( this.datasource = "[some string]" ).

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Max's Gravatar For those still using Application.cfm like me, you can add the attribute defaultdatasource="myDb" to the application tag. And it works! :)
# Posted By Max | 23.02.10 09:48
micha's Gravatar we support every property that is possible in application.cfc in tag cfaplication as well like:
- mappings
- customtagpaths
- datasource (alias defaultdatasource)

why "defaultdatasource" is needed?
in ACF (and upcoming Railo version) "datasource" is also used as orm (hibernate) source, but when you prefer not to have the same datasource for orm and as default datasource, you can use "defaultdatasource" instead.
railo always first check for "defaultdatasource" and then for "datasource". upcoming version that supports orm will also have the alias "ormdatasource"
# Posted By micha | 05.03.10 11:03
Mark Z's Gravatar Thanks for the review. You've saved much of my time as I'm currently
surfing the web looking for some additional tips and tutorials on
this. I also managed to find a couple of useful articles on CF at http://www.pdfok.com/application-cfm , I hope it's gonna be useful.
# Posted By Mark Z | 02.09.10 10:09
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1.002. Contact Blog Owner