We're right in the throes of this, too.  We've been operating under the understanding 
that using Duplicate() was necessary ONLY when dealing with complex variables.

Thus,
<cfset request.variablename = session.variablename>
would work fine as long as session.variablename is not complex.

NOT SO, says MM Tech Support.  Seems like cfset ALWAYS sets a pointer rather than 
making a copy when dealing with shared-scope variables (session, application, server).

I gotta test this out, 'cause we've been having some real serious "variable vanishes" 
problems, and this could be it.  

Sure wish CF worked like it's documented to work.

Chris Norloff



---------- Original Message ----------------------------------
from: David Shadovitz <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Tue, 07 Aug 2001 11:04:21 -0700

>But these variables are simple strings (I think "str" here means "string", not 
>"structure").  There's no need to use Duplicate() for simple CFML variables.
>
>You may want to use Duplicate() on the entire Session structure, but not on a 
>string.
>
>-David
>
>On Tuesday, August 07, Matthew W Jones [SMTP:[EMAIL PROTECTED]] 
>wrote:
>> Yes
>>
>> -----Original Message-----
>> From: Ken Wilson [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, August 07, 2001 10:01 AM
>> Subject: RE: I don't understand session locking :(
>>
>> Wouldn't you actually need to use the Duplicate() function here when
>> referencing the session variable? I seem to recall past discussions that the
>> process of making a copy in this way actually only created a pointer to the
>> session variable and left you vulnerable to the locking issue. Using
>> Duplicate(), however, made a true clone of the variable that was free from
>> the locking issues. As in.....
>>
>>   <cfset request.session.strFirstName = Duplicate(session.strFirstName)>
>>
>>
>> #############
>> <!--- lock session and read name/email address --->
>> <cflock scope="session" type="readonly" timeout="30">
>>      <cfset request.session.strFirstName = session.strFirstName>
>>      <cfset request.session.strLastName = session.strLastName>
>>      <cfset request.session.strEmail = session.strEmail>
>> </cflock>
>> #############
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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