Correction... they should all be READONLY locks....
-----Original Message-----

Which code is better and why?

A: Locking the whole loop...

<cflock type="READONLY" scope="SESSION" timeout="10">
        <cfloop collection="#evaluate("session.#attrubites.StructName#")#"
item="locField">
                <cfset "form.#locField#" =
evaluate("session.#attrubites.StructName#.#locField#")>
        </cfloop>
</cflock>


--- or ---

B: Locking the contents in the loop....

<cfloop collection="#evaluate("session.#attrubites.StructName#")#"
item="locField">
        <cflock type="READONLY" scope="SESSION" timeout="10">
                <cfset "form.#locField#" =
evaluate("session.#attrubites.StructName#.#locField#")>
        </cflock>
</cfloop>


--- better yet ---

C: This just occured to me while asking this question....

<cflock type="READONLY" scope="SESSION" timeout="10">
        <cfset locStruct=Duplicate("session.#attrubites.StructName#")>
</cflock>

<cfloop collection="#locStruct#" item="locField">
        <cfset "form.#locField#" = evaluate("locStruct.#locField#")>
</cfloop>


What do the masses have to say about this one?


Justin Hansen - [EMAIL PROTECTED]
Web Application Developer
Interactive Business Solutions, Inc
816-221-5200 ext. 1305
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to