Andrew Scott wrote:
>> <cfset application.flag = true />
> 
> no on its own that can not cause a race condition, but if somewhere else
> there is a read on that variable somewhere then that will cause a race
> condition.

No it doesn't.

The third factor you need is a statement that sets application.flag to 
something else then true.

The fourth factor you need is that your read actually does something 
wrong if it gets a different value then it expected / should get.


> So in that scenario if it potentially can cause a race condition then lock
> it, as Ben Forta says.
> 
> Now as this debate is being discussed because of a CFC inside of a session
> scope, there is an extremely high chance that a race condtion is going to
> occur, so as Ben says lock it.

This debate is in the context of a userbean in the session scope and 
sessions that end prematurely. I would not bother with locking now. 
Sure, in the case of an update to the bean that may give you a one in a 
million chance that on one request you see somebodies old address but 
his new postcode. Big deal. What it does not influence is the chance of 
a premature session end. And since that is an actual, frequently 
occurring problem for OP, the focus should be on solving that problem.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

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

Reply via email to