Jul 22
With the release of ColdFusion 9 you can do nearly everything in script syntax that you were able to do using tags, including executing queries. I'm not really sure when this feature was introduced in Railo (probably 3.2), but you can do this in Railo as well. However, I found one inconsistency today when doing a query-of-query using script syntax.
In ColdFusion, there is a dbtype argument to the execute() method of the Query object. So to do a query-of-queries you can just specify dbtype="query" when you execute your query:
<cfscript>
// myQuery is a predifined query
// so I can execute a query against myQuery this way:
qoq = new Query();
qoq.setSQL("select * from myQuery where foo = 'bar'");
qoq.execute(dbtype="query").getResult();
</cfscript>
But when I ran this code in Railo (latest BER version 3.30.023). I got the error "Table 'mydsn.myQuery' doesn't exist"
So it was looking for a table in my db named 'myQuery' and seemed to ignore the dbtype="query" argument that I passed into the execute() function. Fortunately, you can look right into the workings of Railo's Query object by opening WEB-INF/railo/components/org/railo/cfml/Query.cfc, and by doing that you can see that there is no dbtype argument specified for execute(). However, it turns out that you can get it to work in Railo by using the setDBType() method.
<cfscript>
qoq.setDBType("query");
qoq.execute().getResult();
</cfscript>
Basically Query.cfc extends a Base.cfc component which uses onMissingMethod to enable using setters for passing in things that you would use attributes for in the tag version. So it's one extra line of code, but it works. And the good news is that it also works in ColdFusion 9. Since it is inconsistent with CF9, I submitted an issue for it. But I just thought I'd post this in case someone else runs into this issue.
Apr 21
Below is a screenshot of my Railo Development server showing the change log for the latest development release (version 3.1.2.011).

Take special note of the last 3 tickets. That's right -- you can now write properties, components, and interfaces in full cfscript with the latest development release of Railo. Thanks to Sean Corfield for pointing my attention to this. Enjoy!
Apr 1
I recently had a chance to listen to the latest edition of the This
Week in ColdFusion Podcast wherein design patterns are discussed.
One of the design patterns that Brian Carr talks about in the podcast is
the Decorator Pattern.
As an example, Brian describes how you can use the dynamic nature of
ColdFusion to assign a function to a variable and then add that function
to an object at runtime (this is also known as "method injection"). Bob Silverberg, who was a
guest on the podcast then asked Brian whether the injected method would
show up in the object's metadata if you called the getMetaData()
function on it. Brian didn't know for sure, but he and Bob agreed that
it was unlikely. This piqued my curiosity, so I set about to test this
myself.
Read more...
Feb 12
I know it's been very quiet here of late. I have a list of things I want to blog about, but between family time and client projects, it's been easy to put blogging low on the priority list. However, I have resolved to start managing my time to make more room for blogging and start crossing things off that list.
Two projects in particular (which I hope to be able to blog about soon) have been taking up a lot of my development time. One has me heavily into Mura CMS plugin development, and for the other I've been working with Railo CFC-based custom tags. I've been learning so much about both, so I have decided to submit a couple of topics for the upcoming CFUnited Conference.
CFUnited has opened topic voting to the public, so if you're interested in any of my topics, just go the the voting page and search for topics by Tony Garcia. There were a couple of other submissions on Mura plugin development, but I think I was the only one who had a topic on the CFC-based custom tags. It would be an incredible honor for me to speak at the conference, and I'll try my hardest to make it worth your while if I get to speak! Thanks!
Read more...
Dec 30
That's right -- I did it. I made the move to Railo. My original plan was to wait for the open source version 3.1 to be released. But after playing with Railo 3 for a while and testing my sites on my local development box, I've been nothing but impressed with its performance and how my CF8 sites "just work" on Railo. So I called up my host, Viviotech, set up a new Linux VPS, installed Railo 3 (Community Edition), migrated the sites from my former CF8-powered VPS (which include this blog and a couple of other sites) and shut that one down.
What can I say? Gert Franz, Michael Streit and co have done an amazing job with Railo. I upgraded my blog to the latest version of Mango, which is Railo-compatible, and my ColdBox sites are just screaming along. And I definitely can't complain about the fact that my hosting costs have been reduced to less than half of what they used to be. Also, any newcomers to Railo should join the Railo_Talk group on Yahoo Railo Google Group. The Railo guys are very responsive in helping people out.
Many thanks to Gert and Co. I'm really looking forward to Railo 3.1!
10-8-2010
8-30-2010
6-1-2010
4-21-2010
4-1-2010