my man, My Man!
thank you dave.

that's probably the funniest thing I have read this morning
and the most informative email I have gotten in a long time
in regards to locking (kinda wish I'd made it to the locking
session last year @ devcon)

but anyway, it makes sense, plain and well done.

thank you!

ps...i implemented this into my code @ my office @ my real
job this morning, and things are humming along....

now, I guess my next question would be, is the cflock timeout
sort of an arbitrary guess as to what would be a good amount of time?
I mean, how long are the lock timeouts on the heaviest hit
cf pages set for? whats a good number?

..tony

Tony Weeg
Senior Web Developer
Information System Design
Navtrak, Inc.
Fleet Management Solutions
www.navtrak.net
410.548.2337 


-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 23, 2002 1:52 AM
To: CF-Talk
Subject: RE: WHYYYYY!!!!!!


> 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!)
::::::::::::::::::::::::::::::::::::::::::::::::::::::


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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

Reply via email to