Dave,
Forgive my stupidity, but once I lock the session.cart, I shouldnt have to lock every reference to it. correct? Doug ----- Original Message ----- From: "Dave Watts" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, December 04, 2001 10:36 AM Subject: RE: Do I need to lock this? > > I was wondering if I need to lock this, I have locking enabled in my > > application.cfm for sessions? > > > > <CFSCRIPT> > > > > if (not(isDefined("session.cart"))){ > > session.cart = structNew(); > > I'm not sure what you mean by "hav[ing] locking enabled in ... > application.cfm for sessions", but the short answer is, yes, you need to > lock any write to a session variable, unless you've enabled single-threaded > sessions in the CF Administrator (which has its own problems, as mentioned > here last week or so). If you don't have automatic read locking enabled in > CF Administrator, you'll need to lock all reads as well - which is what I > recommend. Basically, if you have the word "Session" in your code, I'd > recommend that you have that in a CFLOCK. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists