Joe,

When you do it this way you are referencing the session variable as a local.
To get a true copy use the duplicate function:


<cflock scope="Session" type="exclusive" timeout="10">
<cfscript>
tmpVar1= duplicate(Session.SomeStruct.var1);
tmpVar2=duplicate(Session.SomeStruct.var2);
</cfscript>
</cflock>

-mk



-----Original Message-----
From: Joe Eugene [mailto:Jebebox@;earthlink.net]
Sent: Friday, October 18, 2002 11:14 PM
To: CF-Talk
Subject: RE: session vars and locking


You are correct... but i think its better to copy the variables to
local scope in one sequence... instead of a lot cflocks..

<cflock scope="Session" type="READONLY" timeout="10">
<cfscript>
tmpVar1=Session.SomeStruct.var1;
tmpVar2=Session.SomeStruct.var2;
</cfscript>
</cflock>

<cflock scope="Session" type="Exclusive" timeout="10">
<cfscript>
Session.SomeStruct.var1=Var1;
Session.SomeStruct.var2=Var2;
</cfscript>
</cflock>

You can refer to the local scope variables in your page.


Joe


> -----Original Message-----
> From: Tony Weeg [mailto:tony@;navtrak.net]
> Sent: Friday, October 18, 2002 9:00 PM
> To: CF-Talk
> Subject: session vars and locking
>
>
> hi there
>
> is it safe to assume that everywhere on a page, where i am either
> setting or reading from session variables, that i should have cflock's
> of the exclusive type (when writing to session vars) and cflocks of
> the readonly type (when reading from session vars) on every single
> occurence
> of one of these situations?
>
> without fail, i mean do every single one of them in one way or the
> other?
>
> thanks.
>
> ...tony
>
> tony weeg
> [EMAIL PROTECTED]
> www.revolutionwebdesign.com
> rEvOlUtIoN wEb DeSiGn
> 410.334.6331
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to