How do you handle
locking of instance data in an application scoped CFC?
The CFC shouldn't
care what scope it is called in, but I have one that will ALWAYS be in the
application scope. When setting the instance data, should I lock the entire
call? I have some very time consuming calculations that need to occur
before assigning the data to the instance scope. I suppose I could perform the
calculations in one method call and then lock a subsequent method call to set
the data. But the lock, I'm thinking should be outside the call not inside
the method.
ON the other hand,
if I use a named lock it doesn't matter, does it. I'm just thinking out
loud here and was wondering what others do. Dose this make
sense?
Here's some pseudo
code:
component
name="appscopedcfc"
function1
do some complicated stuff and return a structure of
values
fucnction2
<cflock name=function2lock>
<cfset some instance values>
</lock>
code
getstuff=application.objappscopedcfc.function1();
application.objappscopedcfc.function2(getstuff);
----------------------------------------------------------You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
