<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eric Fickes &#187; coldfusion</title>
	<atom:link href="http://ericfickes.com/tag/coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericfickes.com</link>
	<description>Design minded Internet Programmer</description>
	<lastBuildDate>Fri, 28 Oct 2011 04:14:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eleven Coldfusion-ish tips from the field</title>
		<link>http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/</link>
		<comments>http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 08:34:49 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[adobe]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[asc]]></category>
		<category><![CDATA[cfml]]></category>
		<category><![CDATA[cfscript]]></category>
		<category><![CDATA[chr]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[listcontains]]></category>
		<category><![CDATA[listfind]]></category>
		<category><![CDATA[listhasvalue]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[parameterized query]]></category>
		<category><![CDATA[special character]]></category>
		<category><![CDATA[sproc]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[stored procedure]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1965</guid>
		<description><![CDATA[I&#8217;ve had this running list of Coldfusion tips on my wall for the last few years and it&#8217;s time to get these online.  All of the items in this list came from Coldfusion projects over the last few years, but &#8230; <a href="http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had this running list of Coldfusion tips on my wall for the last few years and it&#8217;s time to get these online.  All of the items in this list came from Coldfusion projects over the last few years, but a good portion of these could easily be considered tips for server programmers.  I definitely run into the same items when programming Asp.NET.</p>
<p>There is no rhyme or reason here, just some things I felt need to be repeated.</p>
<h2>1. <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_m-r_14.html" target="_blank">PreserveSingleQuotes</a>()</h2>
<p>This one came in really handy on a project requiring large text files to be imported into a MySQL database.  I used Coldfusion to upload and read the files into large INSERT chunks using <a href="http://dev.mysql.com/doc/refman/5.5/en/insert.html" target="_blank">MySQL&#8217;s multi &#8211; row INSERT syntax</a>. Code built the VALUES portion of the SQL, then I just fed the data into a function for insertion.</p>
<pre class="brush: sql; title: ; notranslate">
INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
</pre>
<pre class="brush: coldfusion; title: ; notranslate">
	&lt;cfquery name=&quot;insert_data&quot; result=&quot;insert_result&quot; DATASOURCE=&quot;#request.dsn#&quot; USERNAME=&quot;#request.dbuser#&quot; PASSWORD=&quot;#request.dbpswd#&quot;&gt;
	INSERT INTO table
	( column1, column2, column3, column4, column5, column6, column7 )
	VALUES
	#PreserveSingleQuotes( insert_values )#
	&lt;/cfquery&gt;
</pre>
<h2>2. What if GENERATED_KEY doesn&#8217;t work?</h2>
<p>If you&#8217;re using MySQL and the GENERATED_KEY property of your cfquery objects isn&#8217;t populating, you can use <a href="http://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id" target="_blank">LAST_INSERT_ID</a> instead.</p>
<pre class="brush: sql; title: ; notranslate">SELECT LAST_INSERT_ID();</pre>
<h2>3. Use ArrayAppend when building strings</h2>
<p>Classic performance tuning tip for just about any programming language.  Here I&#8217;ll give a Coldfusion example and keep it dead simple.  If you ever have to concatenate strings in code, user ArrayAppend instead.  Here are two loops that do the same thing.  If you run this code, you should notice loop1 takes forever, and loop2 is smoking fast.</p>
<p><strong>slow&#8230;..</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
xx				= 100000;
insertString	= &quot;&quot;;

// do the loop
while( xx &gt; 0 ) {
	insertString &amp;= xx &amp; &quot; &quot;;
	xx--;
}

WriteOutput( insertString);
&lt;/cfscript&gt;
</pre>
<p><strong>FAST!</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
xx				= 1000000;
insertArray		= ArrayNew(1);
// do the loop
while( xx &gt; 0 ) {
	ArrayAppend( insertArray, xx &amp; &quot; &quot; );
	xx--;
}

WriteOutput( ArrayToList( insertArray, &quot; &quot; ) );
ArrayClear( insertArray );
&lt;/cfscript&gt;
</pre>
<h2>4. If CSV, then CHR</h2>
<p>This one is simple, if you find yourself creating CSV or any other text file, use special characters when dealing with single and double quotes, etc.</p>
<ul>
<li>chr(9) = Tab</li>
<li>chr(34) = &#8221; double quote</li>
<li>chr(39) = &#8216; single quote</li>
</ul>
<p>And if you&#8217;re not sure of the correct code for the character you&#8217;re looking to use, just wrap that character in <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_a-b_25.html" target="_blank">ASC()</a> and <a href="http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ecf.html" target="_blank">WriteOutput</a> to the page.</p>
<h2>5. Use CFMail with GMail</h2>
<p>This is a no brainer, but with how difficult sending email can be with <em><a title="I love .NET, but it's a pain in the butt sometimes" href="http://www.google.com/search?sourceid=chrome&amp;ie=UTF-8&amp;q=send+email+with+ASP.NET" target="_blank">other languages</a></em>, I&#8217;m mentioning it here.</p>
<p><strong>Application.cfc</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
	APPLICATION.mail.server		= &quot;smtp.gmail.com&quot;;
	APPLICATION.mail.port		= &quot;465&quot;;
	APPLICATION.mail.ssl		= true;
	APPLICATION.mail.user		= &quot;gmailAccount&quot;;
	APPLICATION.mail.pswd		= &quot;gmailPasssword&quot;;
&lt;/cfscript&gt;
</pre>
<p><strong>Emailer.cfm</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfmail to=&quot;work@ericfickes.com&quot;
		bcc=&quot;&quot;
		from=&quot;web@master.com&quot;
		subject=&quot;sending mail is easy with Coldfusion&quot;
		server=&quot;#application.mail.server#&quot;
		useSSL=&quot;#application.mail.ssl#&quot;
		port=&quot;#application.mail.port#&quot;
		username=&quot;#application.mail.user#&quot;
		password=&quot;#application.mail.pswd#&quot;&gt;
#emailBody#
&lt;/cfmail&gt;
</pre>
<h2>6. CFSCRIPT doesn&#8217;t know NULL?</h2>
<p>Another tip from the land of importing and exporting data.  While working with query objects in CFScript, for some reason I could never accurately detect for NULL values.  I tried all sorts of detection schemes and ended up just writing a hacky fail safe.  Please, if you have a better suggestion for *easy* NULL detection in CFSCript, add it in the comments below.</p>
<p><strong>utils.cfc</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;!---  Simple value getter with try / catch to get around NULL values
This function originated in a script where we always needed a &quot; &quot; even if
the value from the database was null.
---&gt;
&lt;cffunction name=&quot;qryGetString&quot; access=&quot;public&quot; returntype=&quot;string&quot;&gt;

&lt;cfargument name=&quot;data&quot; type=&quot;string&quot;&gt;

&lt;cftry&gt;
	&lt;cfscript&gt;
	return #data# &amp; &quot; &quot;;
	&lt;/cfscript&gt;

	&lt;cfcatch type=&quot;Any&quot;&gt;
		&lt;cfreturn &quot; &quot;/&gt;
	&lt;/cfcatch&gt;
&lt;/cftry&gt;

&lt;/cffunction&gt;
</pre>
<p><strong>Exporter.cfm</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
// largeish loop
tab = chr(9);
for( xx = 1; xx &lt;= queryObj.RecordCount; xx++ )
{
	// start the row
	this_row = 	utils_cfc.qryGetString( queryObj.FirstName[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.MiddleName[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.LastName[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.Suffix[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.MedicalTitle[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.email[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_phone[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_fax[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_name[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_address1[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_address2[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_city[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_state[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_zipcode[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.hospital_affiliation[xx] ) &amp; tab;

	// do stuff with the data
}
</pre>
<h2>7. How I find list items</h2>
<h2><span style="font-size: 16px; color: #444444; line-height: 24px;">Ever notice the different behavior in the Coldfusion ListFind commands?  I ended up writing my own ListHasValue function in order to find exact pattern matching in a list.  I had a list of role ids in a list, and just couldn&#8217;t get the built in functions to tell me when my id was in the list without also matching on other ids.  This one makes sense when you run some code.</span></h2>
<p>The top of this sample as my custom ListHasValue() command, and the lower half does three simple loops counting from 1 to 100, and using ListFind, ListContains, and ListHasValue for number checking against the same list.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;!---
	Use this to do an exact pattern check for a value in a list.
	This is useful inside of a loop checking numbers against a number list.

	EX :

	list = &quot;91, 92&quot;

	if you loop from 1 - 100, ListFind and related CF functions will match
	on 1, 2, and 9.  Not just 91 and 92

	Use this when you're looping and you ONLY want to match on 91, or 92

---&gt;
&lt;cffunction name=&quot;ListHasValue&quot; access=&quot;public&quot; returntype=&quot;boolean&quot;&gt;

	&lt;cfargument name=&quot;list&quot; required=&quot;yes&quot; type=&quot;string&quot;&gt;
	&lt;cfargument name=&quot;value&quot; required=&quot;yes&quot; type=&quot;any&quot;&gt;

	&lt;cfscript&gt;
		// clean up to be safe
		list = trim( toString( list ) );

		// check to see if we have a *possible* match
		position = ListContains( list, value ) ;

		if( position &gt; 0 )
		{
			// NOTE : KEEP THE TRIM AND TOSTRING
			found_value = trim( toString( ListGetAt( list, position ) ) );

			if( Compare( value, found_value ) == 0 )
			{
				return true;
			}
		}

		// no match for you!
		return false;
	&lt;/cfscript&gt;

&lt;/cffunction&gt;

&lt;cfscript&gt;
list	= &quot;1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 99&quot;;
xx		= 1;

WriteOutput( &quot;List = &quot; &amp; list &amp; &quot;&lt;hr&gt;&quot;);

while( xx &lt; 100 ) {
	if( ListContains( list, xx ) &gt; 0 )
	{
		WriteOutput( &quot;ListContains found &quot; &amp; xx &amp; &quot;&lt;br&gt;&quot; );
	}
    xx++;
}

WriteOutput(&quot;&lt;hr /&gt;&quot;);

xx = 1;
while( xx &lt; 100 ) {
	// ListFind
	if( ListFind( list, xx ) &gt; 0 )
	{
		WriteOutput( &quot;ListFind found &quot; &amp; xx &amp; &quot;&lt;br&gt;&quot; );
	}
    xx++;
}

WriteOutput(&quot;&lt;hr /&gt;&quot;);

xx = 1;
while( xx &lt; 100 ) {
    // Eric's ListHasValue
	if( ListHasValue( list, xx ) )
	{
		WriteOutput( &quot;ListHasValue found &quot; &amp; xx &amp; &quot;&lt;br&gt;&quot; );
	}
	xx++;
}
&lt;/cfscript&gt;
</pre>
<p>If you run this code on your Coldfusion server, you should notice the following results.  ListContains matches single digits from the loop that do not really exist in the list.  ListFind only finds the number 1?  And finally, my function does exactly what I needed it to do.  Tell me when a specific number exists in a list.</p>
<div id="attachment_1980" class="wp-caption alignnone" style="width: 240px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/cf-list-find1.png" rel="lightbox[1965]"><img class="size-full wp-image-1980" title="cf-list-find" src="http://ericfickes.com/wp-content/uploads/2011/02/cf-list-find1.png" alt="CF ListFind function comparison" width="230" height="559" /></a><p class="wp-caption-text">Coldfusion ListFind functions don&#39;t always behave how I want them to</p></div>
<p><span style="font-size: 16px; color: #444444; line-height: 24px;"><br />
</span></p>
<h2>8. Make PDFs faster</h2>
<p>This could easily be it&#8217;s own topic, but I&#8217;ll say one thing about making PDFs faster with CFDocument.  Only put final content between &lt;cfdocument&gt; and &lt;/cfdocument&gt;.  That is, if you have any processing code, cfqueries, cfloops, inside of your cfdocument tag, your cfml page is running slower than it needs to be.  Here&#8217;s a simple example of one of my cfml pages that has only final content in the cfdocument tags.</p>
<p>The key to this example is moving all of my content creation code into an external file, then including at the top of my page. I always do a check for my main PDF_BODY variable, and then spit out my PDF document.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfinclude template=&quot;code/export_pdf_codefile.cfm&quot;&gt;

&lt;cfif PDF_BODY NEQ &quot;&quot;&gt;

    &lt;cfdocument	name=&quot;provider_profile&quot;
                format=&quot;PDF&quot;
                pagetype=&quot;A4&quot;
                mimetype=&quot;application/pdf&quot;
                orientation=&quot;portrait&quot;
                margintop=&quot;0&quot;
                marginbottom=&quot;0.2&quot;
                marginleft=&quot;0.2&quot;
                marginright=&quot;0.2&quot;
                &gt;
        &lt;cfoutput&gt;#PDF_BODY#&lt;/cfoutput&gt;
    &lt;/cfdocument&gt;

    &lt;!--- send directly to client ---&gt;
    &lt;cfheader name=&quot;Content-Disposition&quot; value=&quot;attachment; filename=#filename#&quot;&gt;
    &lt;cfcontent type=&quot;application/pdf&quot; variable=&quot;#provider_profile#&quot;&gt;

&lt;cfelse&gt;
	No PDF content found
&lt;/cfif&gt;
</pre>
<h2>9. Use parameterized queries</h2>
<p>This is a tip for all server side programmers whether you use Coldfusion, ASP, JSP, PBJ.  Use parameterized queries when doing any database interaction.  It&#8217;s too easy not to use, and you get protection from SQL Injection, as well as enforcing proper data types when speaking to your database.  This is something all server programmers should do regardless of your language, the sample below is for Coldfusion.</p>
<p><strong>BAD</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfquery name=&quot;tblInsert&quot; datasource=&quot;myDb&quot;&gt;
INSERT INTO	myTable
( col1, col2, col3, col4 )
VALUES
( '#Form.field1#', '#Form.field2#', '#Form.field3#' )
&lt;/cfquery&gt;
</pre>
<p><strong>GOOD</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfset val1 = Form.field1&gt;
&lt;cfset val2 = Form.field1&gt;
&lt;cfset val3 = Form.field1&gt;

&lt;cfquery name=&quot;tblInsert&quot; datasource=&quot;myDb&quot;&gt;
INSERT INTO	myTable
( col1, col2, col3, col4 )
VALUES
(
    &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#val1#&quot; /&gt;,
    &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#val2#&quot; /&gt;,
    &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#val3#&quot; /&gt;
)
&lt;/cfquery&gt;
</pre>
<h2>10. Where&#8217;d the time go?</h2>
<p>For the good programmers already using parameterized queries, ever insert a timestamp into your database and find out the date is correct, but the time is always 12:00:00?  Take a closer look at the cfsqltype in your cfqueryparam, I had this exact problem and here&#8217;s what happened.</p>
<p>Using <strong>cf_sql_date does</strong> not include the full date and timestamp, just the date.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfqueryparam cfsqltype=&quot;cf_sql_date&quot; value=&quot;#paymentDate#&quot; /&gt;
</pre>
<p>&nbsp;</p>
<p>Using <strong>cf_sql_timestamp</strong> includes the full date and timestamp I was looking for.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfqueryparam cfsqltype=&quot;cf_sql_timestamp&quot; value=&quot;#paymentDate#&quot; /&gt;
</pre>
<h2>11. Stored Procedures are a little different</h2>
<p>This last one isn&#8217;t much of a tip, but more of a reminder to myself.  I do so much database work that stored procedures are just queries to me, but not so to Coldfusion and the CFQuery tag.  If you want to get data from a stored procedure, you need to use the <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_r-s_22.html" target="_blank">CFStoredproc</a> tag.  Here&#8217;s a sample of passing one argument into a stored procedure, and how to get the resulting data.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfstoredproc	datasource=&quot;myDb&quot; procedure=&quot;GetDataFaster&quot;&gt;

	&lt;cfprocparam type=&quot;in&quot; cfsqltype=&quot;cf_sql_integer&quot; value=&quot;#inputVar#&quot; /&gt;

	&lt;!--- specify sproc result here, cfstoredproc res != returned recordset ---&gt;
	&lt;cfprocresult name = sprocResult&gt;

&lt;/cfstoredproc&gt;

&lt;cfreturn #sprocResult.ColumnFromQuery#&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Coldfusion and ASP.NET coexisting on IIS, where&#8217;d WebResource.axd go?</title>
		<link>http://ericfickes.com/2010/02/coldfusion-and-asp-net-coexisting-on-iis-whered-webresource-axd-go/</link>
		<comments>http://ericfickes.com/2010/02/coldfusion-and-asp-net-coexisting-on-iis-whered-webresource-axd-go/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 19:33:39 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[inetmgr]]></category>
		<category><![CDATA[web.config]]></category>
		<category><![CDATA[webresource.axd]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1109</guid>
		<description><![CDATA[My Monday morning WTF comes from IIS7 on Windows 7.  I recently installed Coldfusion9 on this machine which has a handful of existing ASP.NET 3.5 web applications.  The problem I ran into came after installing Coldfusion9 and electing to configure &#8230; <a href="http://ericfickes.com/2010/02/coldfusion-and-asp-net-coexisting-on-iis-whered-webresource-axd-go/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My Monday morning WTF comes from IIS7 on Windows 7.  I recently installed Coldfusion9 on this machine which has a handful of existing ASP.NET 3.5 web applications.  The problem I ran into came after installing Coldfusion9 and electing to configure all IIS websites to work with CF.  While that is convenient, it ended up breaking one of my ASP.NET applications that was using ASP Validation controls on a login form.  Now that things are figured out, here are the details.</p>
<p>Firing up my ASP.NET application gives me the error message :</p>
<p style="text-align: center;"><strong>The WebResource.axd handler must be registered in the configuration to process this request</strong></p>
<div id="attachment_1110" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/axd-handler-error.png" rel="lightbox[1109]"><img class="size-medium wp-image-1110" title="WebResource.axd handler must be registered" src="http://ericfickes.com/wp-content/uploads/2010/02/axd-handler-error-300x177.png" alt="Misleading web handler error message" width="300" height="177" /></a><p class="wp-caption-text">WebResource.axd handler must be registered</p></div>
<p>Obviously all I could think is WTF?!?!? since this application worked on Friday and now it is broken.  The first thing I want to point out is that in my situation, the suggested solution of mapping WebResource.axd in the httpHandlers section of my web.config did <em><strong>not</strong></em> help this problem.  After some googling I cam across <a title="Problems with ASP.NET 2.0 Applications with Validation Controls" href="http://forums.iis.net/p/1147595/1861983.aspx#1861983" target="_blank">this post on the IIS.NET forums</a> which put me on the right track.  You can read the details there if you want a good background on MS&#8217; response and other users running CF and ASP.NET on the same box.</p>
<p>I&#8217;m happy to say I have three workarounds for this issue.  Hopefully these will help you as well.</p>
<h3>1. Change your AppPool to run in Classic Mode</h3>
<ol>
<li>In inetmgr, put your web application into it&#8217;s own Application Pool ( unless it&#8217;s already in it&#8217;s own pool )</li>
<li>Change that AppPool&#8217;s Managed pipeline mode to &#8220;Classic&#8221;</li>
<li>You should be good to go</li>
</ol>
<div id="attachment_1111" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/change-apppool-2-classic.png" rel="lightbox[1109]"><img class="size-medium wp-image-1111" title="Edit Application Pool &gt; Managed Pipeline Mode" src="http://ericfickes.com/wp-content/uploads/2010/02/change-apppool-2-classic-300x266.png" alt="Change Managed Pipeline Mode to Classic" width="300" height="266" /></a><p class="wp-caption-text">Classic mode is for compatibility ( think IIS6 )</p></div>
<h3>2. Stop using ASP Validation controls</h3>
<p>All ASP.NET Validation controls are hosted by WebResource.axd.  If you stop using ASP Validator controls, the server will stop asking for WebResource.axd.</p>
<div id="attachment_1112" class="wp-caption aligncenter" style="width: 301px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/stop-using-validators.png" rel="lightbox[1109]"><img class="size-medium wp-image-1112" title="Don't use ASP Validator controls" src="http://ericfickes.com/wp-content/uploads/2010/02/stop-using-validators-291x300.png" alt="Comment out ASP Validator controls" width="291" height="300" /></a><p class="wp-caption-text">Removing ASP Validator controls should remove this error</p></div>
<h3>3. Remove Coldfusion handler mappings from your ASP.NET site</h3>
<p>If your ASP.NET app isn&#8217;t using Coldfusion, I would suggest doing this as your solution.  Even if you do need Coldfusion in your ASP.NET app, you could still host your CF app in it&#8217;s own Virtual Directory and request if via ASP.NET.</p>
<ol>
<li>Open inetmgr</li>
<li>Select your web app on the left ( under Default Web Site )</li>
<li>In Features View on the right, double click Handler Mappings</li>
<li>Sort your Handler Mappings by Name, and remove all entries titled &#8220;AboMapperCustom-*&#8221;</li>
<li>Now your ASP.NET should work like a champ.</li>
</ol>
<div id="attachment_1113" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/inetmgr-handlerMappings.png" rel="lightbox[1109]"><img class="size-medium wp-image-1113" title="inetmgr Handler Mappings" src="http://ericfickes.com/wp-content/uploads/2010/02/inetmgr-handlerMappings-300x238.png" alt="IIS7 inetmgr Handler Mappings" width="300" height="238" /></a><p class="wp-caption-text">IIS7 Handler Mappings</p></div>
<div id="attachment_1114" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/remove-cf-mappings.png" rel="lightbox[1109]"><img class="size-medium wp-image-1114" title="Coldfusion9 Handler Mappings" src="http://ericfickes.com/wp-content/uploads/2010/02/remove-cf-mappings-300x242.png" alt="Coldfusion9 Handler Mappings" width="300" height="242" /></a><p class="wp-caption-text">Coldfusion9 Handler Mappings</p></div>
<p>Monday WTF solved.  Now to get back to pushing buttons.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/02/coldfusion-and-asp-net-coexisting-on-iis-whered-webresource-axd-go/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>I wonder if using Coldfusion9&#8242;s ORM would make this easier?</title>
		<link>http://ericfickes.com/2009/12/i-wonder-if-using-coldfusion9s-orm-would-make-this-easier/</link>
		<comments>http://ericfickes.com/2009/12/i-wonder-if-using-coldfusion9s-orm-would-make-this-easier/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 02:50:09 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[adobe]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[coldfusion9]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[structure]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=979</guid>
		<description><![CDATA[Rolling my own SQL solution Recently I was working on a medical website and was tasked with building a doctor directory page that had to pull data from three related tables.  For the viewers at home, here is a simplified &#8230; <a href="http://ericfickes.com/2009/12/i-wonder-if-using-coldfusion9s-orm-would-make-this-easier/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Rolling my own SQL solution</h2>
<p>Recently I was working on a medical website and was tasked with building a <a href="http://sgpn.org/physicians.cfm" target="_blank">doctor directory page</a> that had to pull data from three related tables.  For the viewers at home, here is a simplified view of my tables.</p>
<div id="attachment_981" class="wp-caption aligncenter" style="width: 361px"><a href="http://ericfickes.com/wp-content/uploads/2009/12/doctor-practice-locations.png" rel="lightbox[979]"><img class="size-full wp-image-981" title="doctor-practice-locations" src="http://ericfickes.com/wp-content/uploads/2009/12/doctor-practice-locations.png" alt="Database tables : Doctors, Practices, and Locations" width="351" height="296" /></a><p class="wp-caption-text">Doctors, Practices, and Locations oh my</p></div>
<p>The first version of the page was easy to whip up because we were only showing primary location address which lives in the practices table.  ( NOTE : The diagram above was dumbed down to support this post ).  When the request came in to show all locations for each doctor&#8217;s practice, that&#8217;s when I had to put on my wizard hat and get tricky.</p>
<p>After some thinking I came up with two options for adding all locations for each doctor row :</p>
<ol>
<li>Build a second locations query for each doctor in the first query, then use code to merge the data together</li>
<li>Update the first query to include all necessary data, then use code to merge the data into a loopable structure</li>
</ol>
<p>Being a SQL junky, I decided to take the second route so I&#8217;m still only hitting the database once.  In the first version of this page, we always had one row per doctor and didn&#8217;t have to do any post processing of the data prior to sending to the page.  However, when the locations table gets added to our sql query, all of the doctor data gets duplicated for each location they are associated with, making the dataset look like this.</p>
<div id="attachment_984" class="wp-caption aligncenter" style="width: 474px"><a href="http://ericfickes.com/wp-content/uploads/2009/12/doctor-query.png" rel="lightbox[979]"><img class="size-full wp-image-984" title="doctor-query" src="http://ericfickes.com/wp-content/uploads/2009/12/doctor-query.png" alt="doctors, practice, and locations all in a single query" width="464" height="216" /></a><p class="wp-caption-text">When joining the third table, the first two get duplicated</p></div>
<p>Now that we&#8217;ve got all the data, you&#8217;ll notice that the doctor information gets duplicated.  This is where I built a cffunction to convert this query into a structure of individual doctors, each having an array of locations.  I used the doctor&#8217;s full name and id as the structure keys.  Great, now I can just loop through my new structure of doctors, then loop through each doctor.location array to draw the updated html table.  That is the goal here, but we&#8217;re not ready just yet.</p>
<p>If you&#8217;ve ever tried to <a title="cfloop: looping over a COM collection or structure" href="http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-71a6.html" target="_blank">loop over a Structure in Coldfusion</a>, you&#8217;ve probably noticed controlling the order of your data coming back can be tricky.  Here&#8217;s an example of what I&#8217;m talking about when looping through a structure.</p>
<div id="attachment_987" class="wp-caption aligncenter" style="width: 383px"><a href="http://ericfickes.com/wp-content/uploads/2009/12/simple-struct-loop.png" rel="lightbox[979]"><img class="size-full wp-image-987" title="simple-struct-loop" src="http://ericfickes.com/wp-content/uploads/2009/12/simple-struct-loop.png" alt="Looping through CF Structures, doesn't always loop in the order you'd expect" width="373" height="184" /></a><p class="wp-caption-text">Looping through a coldfusion structure can be a challenge</p></div>
<p>To get around this random order of looping through a structure, I did two steps prior to building the updated html table.</p>
<pre class="brush: coldfusion; title: ; notranslate">
	// UPDATE : extract key list ( DR full names ) so
	// you can sort the physicians my last name
	dr_list = StructKeyList( providers_struct );
	dr_list = ListSort( dr_list, &quot;textnocase&quot; );
</pre>
<p>This gives me an alphabetized list of all doctors inside my structure, which I convert to an array then loop through.  I know have a sorted loop that can pick all necessary doctor data out of my structure on command.  This solution took a little bit of time to figure, but wasn&#8217;t too bad.  After thinking about all the work needed to make this update, I wondered if using Coldfusion9&#8242;s Hibernate ORM would have made this update any easier.</p>
<h2>Porting SQL to ORM</h2>
<p>The first step in setting up  <a title="ColdFusion 9 has Hibernate built right in!" href="http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSD628ADC4-A5F7-4079-99E0-FD725BE9B4BD.html" target="_blank">Coldfusion9&#8242;s ORM</a> for this code is to enable the ORM in the application.</p>
<p>At the top of my Application.cfc I added the following lines.</p>
<pre class="brush: coldfusion; title: ; notranslate">
	&lt;cfscript&gt;
		// enable ORM
		this.ormenabled = true;

		// my datasource name, setup in the CFAdmin
		this.datasource = &quot;mysql-test&quot;;

		// the folder in my app where the cfc mapping files are location
		this.ormsettings.cfclocation = &quot;mappings&quot;;

		// this wasn't setup automatically for me
		this.ormsettings.dialect = &quot;MySQL&quot;;
	&lt;/cfscript&gt;
</pre>
<p>If you haven&#8217;t setup ORM in your Coldfusion9 application before, be sure to bookmark <a title="How do I configure ORM in Coldfusion9" href="http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSED380324-6CBE-47cb-9E5E-26B66ACA9E81.html" target="_blank">this livedoc page on configuring ORM</a>.  It will give you all the lowdown on all the fancy ORM bells and whistles.</p>
<p>After ORM is enabled, it was time to create my Hibernate mapping files for each of the database tables involved in this code.  For convenience sake, I went the CFC route, and only mapped the columns required for this example.  There are a number of ways to <a title="Define ORM mapping in Coldfusion9" href="http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS53C28604-E798-4175-97AE-D7BDF124056C.html" target="_blank">define ORM mappings, refer to this livedocs page to find out more.</a> Here are my three hibernate mapping cfcs.</p>
<p><strong>doctor.cfc</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfcomponent persistent=&quot;true&quot; entityname=&quot;Doctor&quot; table=&quot;providers&quot;&gt;
    &lt;cfproperty name=&quot;id&quot; column=&quot;provider_id&quot; generator=&quot;increment&quot;&gt;

    &lt;!--- one to many relationship Doctor.practice = Practice ---&gt;
    &lt;cfproperty name=&quot;practice&quot; fieldtype=&quot;one-to-one&quot; cfc=&quot;PRACTICE&quot; fkcolumn=&quot;practice_id&quot;&gt;

    &lt;cfproperty name=&quot;PracticeId&quot; column=&quot;practice_id&quot; insert=&quot;false&quot; update=&quot;false&quot;&gt;

    &lt;cfproperty name=&quot;FirstName&quot; column=&quot;first_name&quot;&gt;
    &lt;cfproperty name=&quot;LastName&quot; column=&quot;last_name&quot;&gt;
    &lt;cfproperty name=&quot;status&quot; column=&quot;status&quot;&gt;
    &lt;cfproperty name=&quot;is_midlevel&quot; column=&quot;is_midlevel&quot;&gt;
&lt;/cfcomponent&gt;
</pre>
<p><strong>practice.cfc</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfcomponent persistent=&quot;true&quot; entityname=&quot;Practice&quot; table=&quot;practices&quot;&gt;
	&lt;!--- tie this column back to Doctor.practice_id ---&gt;
	&lt;cfproperty name=&quot;id&quot; column=&quot;practice_id&quot; fieldtype=&quot;id&quot; generator=&quot;foreign&quot; params=&quot;{property='Doctor'}&quot;&gt;

	&lt;!--- Relate locations to this practice via Locations.practice_id and Locations.active = 1 ---&gt;
        &lt;cfproperty name=&quot;locations&quot; type=&quot;array&quot; fieldtype=&quot;one-to-many&quot; cfc=&quot;Location&quot; fkcolumn=&quot;practice_id&quot; params=&quot;{property='Location'}&quot; where=&quot;active = 1&quot;&gt;

    &lt;cfproperty name=&quot;name&quot; column=&quot;practice_name&quot;&gt;
    &lt;cfproperty name=&quot;active&quot; column=&quot;active&quot;&gt;
&lt;/cfcomponent&gt;
</pre>
<p><strong>location.cfc</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfcomponent persistent=&quot;true&quot; entityname=&quot;Location&quot; table=&quot;locations&quot;&gt;
	&lt;cfproperty name=&quot;id&quot; column=&quot;location_id&quot; fieldtype=&quot;id&quot;&gt;

	&lt;cfproperty name=&quot;practice_id&quot; column=&quot;practice_id&quot;&gt;

    &lt;cfproperty name=&quot;address1&quot; column=&quot;address1&quot;&gt;
    &lt;cfproperty name=&quot;address2&quot; column=&quot;address2&quot;&gt;
    &lt;cfproperty name=&quot;city&quot; column=&quot;city&quot;&gt;
    &lt;cfproperty name=&quot;state&quot; column=&quot;state&quot;&gt;
    &lt;cfproperty name=&quot;zipcode&quot; column=&quot;zipcode&quot;&gt;
    &lt;cfproperty name=&quot;phone&quot; column=&quot;phone&quot;&gt;
    &lt;cfproperty name=&quot;active&quot; column=&quot;active&quot;&gt;
&lt;/cfcomponent&gt;
</pre>
<p>At this point we have three ORM entities that are mapped to the three database tables.  If you look closely, you&#8217;ll notice that relationships have also been defined for doctors to practice, and practice to locations.  Setting up the relationships at the mapping level takes care of physically joining the three tables together via sql.  Also, while it&#8217;s pretty straight forward reading a blog with working code, I&#8217;m not going to pretend I got these relationships setup first try.  It&#8217;s simple relating two tables together, but finding the right combination for doctror &gt; practice &gt; locations was tricky.  I did a lot of this to figure this part out.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
// load doctors
dr_list = ORMExecuteQuery( &quot;FROM Doctor WHERE status = 'Active' AND provider_id = 1&quot; );
// load a practice
// practice = ORMExecuteQuery( &quot;FROM Practice WHERE practice_id = 1&quot; );
// load a location
// location = ORMExecuteQuery( &quot;FROM Location&quot; );
&lt;/cfscript&gt;

&lt;cfdump var=&quot;#dr_list#&quot; /&gt;
&lt;cfabort /&gt;
</pre>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;">You can find out more about <a title="How to define relationships with Coldfusion9 ORM" href="http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS5FFD2854-7F18-43ea-B383-161E007CE0D1.html" target="_blank">defining ORM relationships on this livedocs page</a>.</span></p>
<p>With the hard stuff out of the way, we&#8217;re down to two steps.  First it&#8217;s time to port my cfquery that grabs the data, and the cffunction that converts the query into our loopable doctor structure.  Are you ready for this?</p>
<pre class="brush: coldfusion; title: ; notranslate">
dr_list = ORMExecuteQuery( &quot;from Doctor WHERE status = 'Active' AND is_midlevel = 0 ORDER BY last_name, first_name&quot; );
</pre>
<p>To give you the full idea of how much code was shrunk down to a single line, here are the two cffunctions used to query and massage the data into a useable structure.</p>
<pre class="brush: coldfusion; title: ; notranslate">
	&lt;!--- Retrieve listing of all active providers in the app  ---&gt;
    &lt;cffunction name=&quot;getAllActiveProviders&quot; access=&quot;public&quot; returntype=&quot;struct&quot;&gt;

		&lt;cfquery name=&quot;providers_qry&quot; DATASOURCE=&quot;#request.dsn#&quot; USERNAME=&quot;#request.dbuser#&quot; PASSWORD=&quot;#request.dbpswd#&quot;&gt;
            SELECT	DISTINCT

					p.provider_id,
            		CONCAT( p.first_name, ' ', p.last_name ) AS 'full_name',
                    p.first_name,
                    p.last_name,

    	            p2.practice_name,

					l.address1,
                    l.address2,
                    l.city,
                    l.state,
                    l.zipcode,
                    l.phone

            FROM	providers p, practices p2

            LEFT OUTER JOIN locations l
            ON p2.practice_id = l.practice_id AND l.active = 1

            WHERE	p.status = 'Active'
            AND		p.practice_id = p2.practice_id
            AND		is_midlevel = 0

            ORDER BY	p.last_name, p.first_name
        &lt;/cfquery&gt;

		&lt;!--- return a translated structure ---&gt;
		&lt;cfreturn providersQryToStruct( providers_qry ) /&gt;

    &lt;/cffunction&gt;

	&lt;!--- Translates the providers query into a Struct that has a row per doctor, each containing an Array for location(s) ---&gt;
	&lt;cffunction name=&quot;providersQryToStruct&quot; access=&quot;public&quot; returntype=&quot;struct&quot;&gt;

    	&lt;cfargument name=&quot;providers_qry&quot; type=&quot;query&quot; required=&quot;yes&quot;&gt;

		&lt;cfscript&gt;
		this_dr = &quot;&quot;;
		last_dr = &quot;&quot;;
		// array of provider arrays
		providers_struct = StructNew();

		// loop through qry and flatten into single row with Location = Array
		// The key to this qry is provider_name+provider_id
		for( xx = 1; xx &lt;= providers_qry.RecordCount; xx++ )
		{
			// set key to this row [ LAST_NAME+FIRST_NAME+PROVIDER_ID ]
			this_dr = providers_qry.LAST_NAME[ xx ] &amp; providers_qry.FIRST_NAME[ xx ] &amp; providers_qry.PROVIDER_ID[ xx ];

			// clean up DR name
			this_dr = Replace( this_dr, &quot; &quot;, &quot;&quot; );
			this_dr = Replace( this_dr, &quot;,&quot;, &quot;&quot; );
			this_dr = Replace( this_dr, &quot;.&quot;, &quot;&quot; );

			// got same doctor?
			if( this_dr != last_dr )
			{
				// append to array
				provider = StructNew();
				// FILL UP PROVIDER
				provider['full_name'] = providers_qry[&quot;full_name&quot;][ xx ];
				provider['practice_name'] = providers_qry['practice_name'][ xx ];

				// location array
				provider['location'] = ArrayNew(1);

				// add first location
				loc = StructNew();
				loc['address1']	 = providers_qry['address1'][ xx ];
				loc['address2']	 = providers_qry['address2'][ xx ];
				loc['city']		 = providers_qry['city'][ xx ];
				loc['state']	 = providers_qry['state'][ xx ];
				loc['zipcode']	 = providers_qry['zipcode'][ xx ];
				loc['phone']	 = providers_qry['phone'][ xx ];

				// add location struct to array
				ArrayAppend( provider['location'], loc );

				// Add to master struct
				providers_struct[ this_dr ] = provider;
			}
			else
			{
				// add first location
				loc = StructNew();
				loc['address1']	 = providers_qry['address1'][ xx ];
				loc['address2']	 = providers_qry['address2'][ xx ];
				loc['city']		 = providers_qry['city'][ xx ];
				loc['state']	 = providers_qry['state'][ xx ];
				loc['zipcode']	 = providers_qry['zipcode'][ xx ];
				loc['phone']	 = providers_qry['phone'][ xx ];

				// Append to this DR's location array
				ArrayAppend( providers_struct[ this_dr ]['location'], loc );
			}

			// store this_dr in last_dr for next iteration
			last_dr = this_dr;
		}

		return providers_struct;
        &lt;/cfscript&gt;

    &lt;/cffunction&gt;
</pre>
<p>After going through the brain fry of figuring out ORM relationships, replacing over one hundred lines of code with only a single line really made my day.  Now it was time for the final step, porting the cfml that draws the html table into using the ORM collection instead.<br />
The porting of the cfml that draws the doctor table was a piece of cake.  The updates were so easy it was almost not worth showing, but I&#8217;m including just to complete the picture.</p>
<p><strong>The original sql loop code</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
    &lt;!--- use dr_list as sorted list. use each DR key to pick out data from providers_struct ---&gt;
    &lt;cfloop list=&quot;#dr_list#&quot; index=&quot;xx&quot;&gt;
    &lt;tr&gt;

        &lt;td&gt;#providers_struct[ xx ]['full_name']#&lt;/td&gt;

        &lt;td&gt;#providers_struct[ xx ]['practice_name']#&lt;/td&gt;

        &lt;td&gt;
        &lt;!--- loop through array of location structures ---&gt;
        &lt;cfloop from=&quot;1&quot; to=&quot;#ArrayLen( providers_struct[ xx ]['location'] )#&quot; index=&quot;yy&quot;&gt;
            &lt;address&gt;
            &lt;cfset loc = #providers_struct[ xx ]['location'][ yy ]#&gt;
            &lt;li&gt;#loc.address1#, #loc.address2#
            #loc.city#, #loc.state# #loc.zipcode#
            &lt;br /&gt;
            &lt;b&gt;#loc.phone#&lt;/b&gt;
            &lt;/li&gt;
            &lt;/address&gt;
        &lt;/cfloop&gt;
        &lt;/td&gt;

    &lt;/tr&gt;
    &lt;/cfloop&gt;
</pre>
<p><strong>The new ORM loop code</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
	&lt;!--- loop through parent query ---&gt;
    &lt;cfloop array=&quot;#dr_list#&quot; index=&quot;xx&quot;&gt;
    &lt;tr&gt;

    	&lt;!--- retrieve properties using ORM's getProperty() syntax ---&gt;
        &lt;td&gt;#xx.getFirstName()# #xx.getLastName()#&lt;/td&gt;

        &lt;td&gt;#xx.getPractice().getName()#&lt;/td&gt;

        &lt;td&gt;
		&lt;!--- loop through locations collection Doctor &gt; Practice &gt; Location(s)  ---&gt;
        &lt;cfloop array=&quot;#xx.getPractice().getLocations()#&quot; index=&quot;loc&quot;&gt;

            &lt;address&gt;
                &lt;li&gt;#loc.getAddress1()#, #loc.getAddress2()#
                #loc.getCity()#, #loc.getState()# #loc.getZipcode()#
                &lt;br /&gt;
                &lt;b&gt;#loc.getPhone()#&lt;/b&gt;
                &lt;/li&gt;
            &lt;/address&gt;

        &lt;/cfloop&gt;
        &lt;/td&gt;

    &lt;/tr&gt;
    &lt;/cfloop&gt;
</pre>
<p>A few things I&#8217;d like to point out in the new ORM loop code</p>
<ol>
<li>ORMExecuteQuery returned a data collection that I can loop through without post-processing</li>
<li>When retrieving object properties, use the get<strong>PropertyName</strong>() syntax.  EX : doctor.getFirstName() instead of doctor.FirstName</li>
<li>Practice.locations was declared as an Array collection, but you could use Structure as well.</li>
<li>To get the ORMExecuteQuery record count, use ArrayLen.</li>
</ol>
<h2>Did ORM make this easier?</h2>
<p>I&#8217;d say yes it did.  Mapping my tables via code, including the relationships, really saved time writing SQL.  Funny thing, while I was porting this over, I actually found a few data and code bugs in the home grown solution that I didn&#8217;t catch before.  Once the dust had settled I still had one difference in the home grown versus ORM code, and that turned out to be duplicated location rows.</p>
<p>The other thing that I noticed thanks to our good friend cfdump, is all the extra functionality that comes along with the objects returned from ORM.  On top of having a populated data object, you also have magical getters, setters, and other useful methods to work with your data objects.  To see what I mean, fire an ORMExecuteQuery and run your variable through CFDUMP.</p>
<p>To sum up, I&#8217;m really starting to buy into using ORMs.  Since I know and love SQL, I&#8217;ve been anti ORM for too long.  Having said that, I&#8217;m not fully advocating going ORM for everything.  Pretty much every project I work on these days is powered by some datasource, but I don&#8217;t really need all the ORM baggage for simple sites.  Now for large applications, or any site large enough to need at least two people, I&#8217;d give ORM a chance.  I still have lots of ins and outs to learn about using Hibernate, but it is definitely simple enough to get jamming right away.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2009/12/i-wonder-if-using-coldfusion9s-orm-would-make-this-easier/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

