I would argue that that is not only a horrible abuse (LOCKING on SEVER to
set something in SESSION), but that this situation doesn't even need a lock
at all. The race condition here seems unimportant. In fact, it is locking
for one CFSET but not the other. Get rid of this lock.

.......................
Ben Nadel 
www.bennadel.com
Certified Advanced ColdFusion Developer

Need Help?
www.bennadel.com/ask-ben/


-----Original Message-----
From: Ken [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 31, 2006 6:04 PM
To: CF-Talk
Subject: CFLOCK problem

Hi. I am analyzing another programmers code for possible code problems that
may be causing our servers to crash every so often, especially under high
traffic.

Can someone please tell if the code below is abusing the cflock. I am
thinking the cflock scope should be set to session instead of server scope.
Could this be responsible for crashing our CF server?

The code is:

<cfif not parameterexists(session.ord)>
<cfif parameterexists(TEXTFIELD)>
<cflock scope="server" type="exclusive" timeout="3600"> <cfset session.ord =
"#TEXTFIELD#"> </cflock> <cfelse> <cfset session.ord = ""> </cfif> </cfif>

Thanks,
K



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251701
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to