Rick, Duplicate() is a function that does just what it sounds like--and is
especially useful when dealing with deeply nested complex vars like
structures, but it doesn't have anything to do with the shared scope issue.
You might be thinking of a technique for turning a shared scope variable
into a local variable, massaging it and then saving it as a shared-scope
variable again. Like this:

<cflock scope="session" type="readonly">
  <cfset localBigStructure = Duplicate( session.BigStructure )>
</cflock>

....do a bunch of stuff to localBigStructure...

<cflock scope="session" type="exclusive">
  <cfset session.BigStructure = Duplicate( localBigStructure )>
</cflock>


Hal Helms
== See ColdFusionTraining.com for info on "Best Practices with ColdFusion &
Fusebox" training ==


-----Original Message-----
From: Rick Lamb [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 10:27 PM
To: CF-Talk
Subject: duplicate() or readonly lock?


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?

Thanks for any help on this. I'm thoroughly confused on this already
confusion subject.

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

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to