Re: duplicate() or readonly lock?
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: -- 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
RE: duplicate() or readonly lock?
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: do a bunch of stuff to localBigStructure... 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists