> I inherited an application that uses session variables and 
> has no CFLOCK tags in it at all! All session variables have 
> a CFPARAM in the Application.cfm, but even there it isn't 
> inside a cflock. I was reading the docs and even if I set 
> the locking to "Automatic Read Locking", I don't think I'm 
> protected from potential locking problems.  
> 
> Am I understanding things correctly?  Do I need to go through 
> every bit of code, find where a session variable is referenced 
> and put it in a ReadOnly lock, and find where a session variable 
> is updated and put it in a Exclusive lock?

Unfortunately, yes, that's about right. You'll need to at least do the last
thing you mention - wrap each write within an exclusive lock. You could then
skip the reads, and use automatic read locking, although that may have its
own problems. My advice is to CFLOCK the writes first, set automatic read
locking, then CFLOCK the reads, then turn automatic read locking off.

While you're doing that, you might also take the time to see exactly what's
being put into the Session scope. Very often, you might find more in there
than you need.

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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to