> > I definitely understand a race condition. what I don't > understand is this: If a race condition could occur, even > 1 time out of 1 hundred thousand iterations, isnt that enough > to lock it? I could imagine, if I had a shopping cart system, > that I would EVER want someone to know what my CC info > was, however, if a race condition is even somewhat a potentiality > then even the smallest chance of occurrence is too much of a risk > > wouldn't you agree? > Yes, but then every use of a shared scope variable isn't necessarily going to generate a race condition.
Simply checking for an application scope variable and setting it to a default value will not cause a race condition, because the value will always be the same. Only if you're reading and then incrementing that application scope variable will you get a race condition. In your example of a shopping cart, locking was required in CF5 and lower because of other issues with session variables. Using session variables in a CFMX application you are unlikely to get a race condition, unless you're using frames in the design of your site. You don't get a race condition if you're only reading a variable and not updating, so you don't need a lock. Stephen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

