In my CF4 and CF5 days I found that it was actually faster to lock an
entire scope (application) then set multiple variables in that scope
before releasing the lock.

I'd do something like:

<cflock scope="Application" timeout="30" type="exclusive">
<cfscript>
        if(not isDefined("Application.datasource"))
Application.datasource = "mydatasource";
        if(not isDefined("Application.adminname")) Application.adminname
= "Steve!";
        ...
</cfscript>
</cflock>

This ran MUCH faster than doing each one individually.  I've just kept
in that habit since then, but I don't think there is a speed difference
with MX or MX7.

Thanks,
Steve




-----Original Message-----
From: James Holmes [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 10, 2006 8:33 AM
To: CF-Talk
Subject: Re: good old CFLOCK question


I'm inclined to agree - use named locks.

On 1/10/06, Baz <[EMAIL PROTECTED]> wrote:
> I know locking questions have come up before... but it's a quickie...
>
> Is there ever a reason to lock an entire scope instead of using named
locks?
> It seems that locking an entire scope just causes extreme inefficiency
> without any advantages...

--
CFAJAX docs and other useful articles:
http://jr-holmes.coldfusionjournal.com/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:229015
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to