In virtually every case, locking session vars has been completely
unnecessary since CFMX (6.0) came out.
On Sun, Dec 7, 2008 at 3:12 PM, j s [EMAIL PROTECTED] wrote:
When creating session structures is it still necessary to cflock in cf8? I
think i read somewhere that it was no longer needed
Lock to avoid problems with race conditions in the places where these
might be an issue. Many Web applications have places where unhandled
race conditions can be a problem.
-Mike Chabot
On Sun, Dec 7, 2008 at 4:36 PM, Matt Quackenbush [EMAIL PROTECTED] wrote:
In virtually every case, locking
To ditto what has already been said, but also to clarify: It is not
necessary to lock your shared scope access for the purpose of not obtaining
corrupted reads. i.e. process 1 attempts to read large session variable
while session 2 is writing to it. ColdFusion will take care of that for you
Read the KB article
http://www.allaire.com/Handlers/index.cfm?ID=20370Method=Full
As for your code:
cflock timeout=30 throwontimeout=Yes type=EXCLUSIVE
scope=SESSION
cfif NOT IsDefined(session.basket)
cfset session.basket = ArrayNew(2)
/cfif
cfset FoundInBasket = 0
!--- Case 1 - Item already
Barney,
Session,application server variables are not protected from simultaneous
read/write access. Therefore you should always use CFLOCK tag when
readin/writing to thyese variable scopes. If you don't, its possible that
several requests could occur at same time. This could corrupt data or
Depending on your use of variables within the site - it may cause "hanging"
of sessions variables, when people from the same network access the site.
For example, when we created a site in eleven different languages (using
session variables set via a log-in) people from the same company where
Don't locking your application, session and server vars means crashing your
cfserver, overwriting session and application information from other running
applications. You are messing up your shared memory. This is why locking is
that important.
-Original Message-
From: Barney Stevenson
7 matches
Mail list logo