You MUST use CFLOCK on any session variables becuase of data integrity.  Say
you hav a user hit reload twice on the same page that is setting and/or
reading a session variable.  Without locks, two threads are then sent to the
CF Server and are both working at the same thing.  This can cause memory
corruption and/or incorrect data being stored/read from that session
variable.

Locking is a very important party of CF coding and without it you WILL be
living at the office 24/7 rebooting the server and have a lot of unhappy
customers.  Also, make sure you include the scope or name when you lock
because it helps the server.

Best Regards,

Greg
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Friday, November 10, 2000 12:09 AM
Subject: When to use CFLock


> At the ColdFusion Developers Conference, at one of the sessions, we were
told
> to use CFLock for all session variables, both when setting them and when
> reading them. And that this was especially important for ColdFusion 4.5
> because it runs 12 times faster than ColdFusion 4.0 and without all those
> CFLocks everywhere, you might crash the server.
>
> Is this true?
> Do I really need to CFLock up my application all over the place?
>
> I just got finished reading the Fusion Authority weekly news alert from
> February where an attempt was made at a ColdFusion style guide and I
quote,
>
> "Lock memory-based state management variables - In CF 4.0 and 4.01, you
have
> to lock the setting of memory based state management variables (Server,
> Application, Session). If you don't, you may find a situation where a
value
> is being written to memory at the same time as it's being read. This will
> result in a PCode error. This has been slightly fixed in 4.5 (thanks to
Seth
> Petry-Johnson for reminding me). "
>
> So I ask again.
>
> Do I need to lock variables in v. 4.5 or don't I???????
>
> Thanks,
>
> Jo-Anne Head
> --------------------------------------------------------------------------
----------------------
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send
a message with 'unsubscribe' in the body to
[EMAIL PROTECTED]
>

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to