On Sat, 24 Feb 2001 21:27:22 -0600, [EMAIL PROTECTED] (Rick Lamb)
wrote:

>I have some confusion on reading shared memory variables. I've been using a
>read locks to read shared memory variables to a request scope for using
>through the site, but I've recently heard of people using the duplicate()
>function to read shared memory variables. Can anybody help me why I should
>use one method over the other? Also, with the duplicate function do I still
>need to lock it?

Rick,

In theory, Duplicate() gets around CF's tendency to pass nested
structures as references rather than copies. Without it, you may end
up corrupting memory just as quickly as you would have without
bothering with the request scope in the first place.

OTOH, some folks' CF boxes can't abide Duplicate(), consistently
returning a never-ending cavalcade of obscure errors. (For me, it
seems to only happen with small queries stored in session variables.)
The alternatives become rather ugly at that point... you're  basically
left with:

<cflock scope="session" type="readonly">
        <cfwddx action="CFML2WDDX" 
                input="#session#" output="temp">
        <cfwddx action="WDDX2CFML" input="#temp#"
                output="request.session">
</cflock>

--
Roger


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to