> i havent used locks on session vars, havent
> needed to, and having never formally learned
> cf, not really 100% down with the thought
> process behind locking session var setting...

The thought process is very simple. If you're running CF 5 or earlier, and
you're using session variables, and you don't lock them, bad things will
happen. Memory variables can be accessed by concurrent requests, and CF
doesn't handle that well, by default. While you might not think session
variables would be used by concurrent requests, there are many possible
cases in which more than one request from the same user might be running
concurrently.

> any good books on that topic?

A book would be overkill, just for this topic. If you're using CF 5 or
earlier, just follow these simple rules:

1. Dvery time you put "Session", "Application" or "Server" in your code, use
CFLOCK around it.

2. If you're using any version of CF which supports the SCOPE attribute
(4.5+, I think), use that with your CFLOCK tags around memory variables.

3. If you're reading a memory variable, use TYPE="READONLY" in your CFLOCK;
if you may change the variable's value, use TYPE="EXCLUSIVE".

4. There is no rule 4.

5. Reread rule 1.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

::::::::::::: dream :: design :: develop :::::::::::::
MXDC 02 :: Join us at this all day conference for 
designers & developers to learn tips, tricks, best 
practices and more for the entire Macromedia MX suite.

September 28, 2002  ::  http://www.mxdc02.com/
(Register today, seats are limited!)
::::::::::::::::::::::::::::::::::::::::::::::::::::::

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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