Should I CFLOCK the following query?
<CFQUERY NAME="Request.GetListings" DATASOURCE="#request.DSN#"
USERNAME="#request.USER#"
PASSWORD="#request.PASS#" cachedwithin="#createtimespan(0,0,15,0)#">
SELECT ID,org_name,contact,city,website_bt,email_bt,classified_bt,fax_bt,TList
FROM Orgs (nolock)
WHERE Class = #VAL(request.hdg_id)#
<CFIF "#CLIENT.CITY#" IS NOT "All Cities" >AND City = '#CLIENT.CITY#'</CFIF>
ORDER BY org_name
</CFQUERY>
For different values of request.hdg_id or CLIENT.CITY, CF will cache the
correct dataset for NEXT/PREVIOUS display of results on a page (since CF
caches reference the SQL too, and not just the cfquery name). There are
potentially many DIFFERENT datasets, ALL titled Request.GetListings (in the
CF template, that is). For example, CF will cache one dataset where
CLIENT.CITY is New York, and another dataset where CLIENT.CITY is Chicago,
and they apparently happily co-exist.
But what happens if we followed Allaire's best practices (in CF4.5 syntax):
<cflock scope="application" timeout="2" type="exclusive">
<cfset application.GetListings = Request.GetListings>
</cflock>
Would the potentially several queries/datasets all named
Request.GetListings (in the CF template) be kept distinct when they are
named application.GetListings?
best, paul
PS> How would I do the above cflock in CF4.x?
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.