>> Also, using an application variable as a query name
probably won't work.
>
> Ugh, I'm going to have to change some production code,
then. :)
Don't go charging off changing code just yet: there's nothing
synactically
incorrect with using an application-scoped variable as the
name of a query.
I'm just wondering what Dan was actually thinking when he
made that (above)
statement.
That said, I'd perhaps do this:
<cfif not structKeyExists(application, "orderType")>
<cfquery name=variables.orderType"
datasource="#datasource#">
SELECT SPECIFY_YOUR_COLUMN_LIST_HERE
FROM oew_orderType
ORDER BY orderType
</cfquery>
<cfset application.orderType = variables.orderType>
</cfif>
Doing this means you don't have to have any <cflocks>
at all, as Java
automatically locks variables whilst a CF statement is
accessing them. If
you were setting it straight with the <cfquery>, I
probably WOULD err
towards locking it, which is going to be a performance hit.
Also don't do SELECT *. It's just lazy.
--
Adam