> -----Original Message----- > From: Larry White [mailto:[EMAIL PROTECTED] > Sent: Monday, January 03, 2005 12:04 PM > To: CF-Talk > Subject: Re: Well - I feel like an idiot. > > Regarding the original post I can't see any reason to use cflock at all. > Initializing the application variables, I would hope, would not entail > using user specific values. If the initialization is the same no matter > which user does it, and you won't crash the server anymore, then why > lock it?
Well - that last question kinda of answered it. With all users running the code it DID crash the server. ;^) The initialization code, in this case, is actually pretty complex but more importantly it would suffer data issues if run multiple times. For example it instantiates a session cache which is stowed in the application scope. Since the current user's session is then stored in that cache it would be a Bad Thing if the next request rebuilt the cache. Sure, I could place <CFIF>'s around all the places that this would matter - but it's much, much cleaner to just wrap the entire process in a lock. Jim Davis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189204 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54