I respectfully disagree. You need to lock EVERY shared scope variable reference in your code... read or write. Early on in CF 4.x, Allaire had said that only writes needed to be locked. However, they have updated their recommendation and have stated that all accesses to shared variables must be locked.
http://www.allaire.com/Handlers/index.cfm?ID=20370&Method=Full One other thing that I noticed below in Dave's comments... he pointed out that you didnt have cflock around your queries because you are using something like "session.dsn"... I recommend that you do NOT use a cflock around queries because it effectively locks the accesses to that query and can really impact performance. Further, like Dave, I also do not recommend that you use session or application to hold your datasource variable (or most other variables for that matter) -- set your variables to the request scope and don't worry about locking at all. I am giving the January presentation on <cflock> and we will talk about "why" and discuss strategies for locking in detail. Jeremy Jeremy Ridout Internet Services Director American College of Emergency Physicians www.ACEP.org -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 27, 2001 12:06 AM To: [EMAIL PROTECTED] Subject: Re: differences in cf 4.5 vs cf 5 Palyne, You should only use CFLOCK when you need to guarantee that shared data structures are modified correctly. Also, CFLock is useful for CFX tags for correct threading and for file manipulation. You do not use it for all session variables. Respectfully, <cf_developer> Phillip B. Holmes Media Resolutions Inc. Premier Allaire Alliance Partner http://www.mediares.com [EMAIL PROTECTED] 1-888-395-4678 Voice: 972-889-0201 Fax: 972-490-8342 </cf_developer> Please mail support issues to: [EMAIL PROTECTED] ----- Original Message ----- From: "Palyne Gaenir" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 26, 2001 11:44 PM Subject: RE: differences in cf 4.5 vs cf 5 Dear Dave, Do your comments below infer that all the applications I have created the last few years which may use a session.value, I have to go through every page on every site and find all the session var references and put cflock tags around every one? Boy. That's a lot of work, if so.... Palyne On 21 Nov 2001, at 10:17, Dave Cahall wrote: > I do not think this should be effecting your page, but I notice > that you do not have CFLOCK tags around your queries and you are > using a session variable for the datasource name. You could also > convert the datasource name to the request scope in your > Application.cfm file and avoid the need for the CFLOCK tags (which > I highly recommend). My experience says this will be a REAL > problem in CF 5.0 is you have shared scope variables without using > CFLOCK tags. ------------------------------------------------------------------------- This email server is running an evaluation copy of the MailShield anti- spam software. Please contact your email administrator if you have any questions about this message. MailShield product info: www.mailshield.com ----------------------------------------------- To post, send email to [EMAIL PROTECTED] To subscribe / unsubscribe: http://www.dfwcfug.org ------------------------------------------------------------------------- This email server is running an evaluation copy of the MailShield anti- spam software. Please contact your email administrator if you have any questions about this message. MailShield product info: www.mailshield.com ----------------------------------------------- To post, send email to [EMAIL PROTECTED] To subscribe / unsubscribe: http://www.dfwcfug.org ------------------------------------------------------------------------- This email server is running an evaluation copy of the MailShield anti- spam software. Please contact your email administrator if you have any questions about this message. MailShield product info: www.mailshield.com ----------------------------------------------- To post, send email to [EMAIL PROTECTED] To subscribe / unsubscribe: http://www.dfwcfug.org
