Nathan Stanford wrote:
>>-----Original Message-----
>>From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
>>Sent: Thursday, July 25, 2002 9:54 AM
>>To: CF-Talk
>>Subject: Re: NEW (ColdFusion MX or ColdFusion 4.5) and 
>>Session Variables
>>( Bug)
>>
>>
>>We have 2 instances of this template running at the same time. At the 
>>time the first instance reaches Point 1, the second instance reaches 
>>Point 2 and grabs the lock to update the value. Will the 
>>first instance 
>>display 0 for session.cartquantity or not?
> 
> Yes.... at Point 1 it is always Zero...

But it can be changed by the other instance. Let's make a little timeline:


Instance 1, first submit:        Instance 2, refresh:

1  init cfapplication

2  set session vars to 0
                                   3  init cfapplication
4  do queries
                                   5  set session vars to 0
6  display session vars
                                   7  do queries
8  update session vars by 1
                                   9  display session vars
10 loop
                                   11 update session vars by 1
12  display session vars
                                   13 loop
14 update session vars by 1
                                   15 display session vars
16 exit
                                   17 update session vars by 1

                                   18 loop

Output:                            Output:
0                                  1
2                                  3

At point 9, the outputted value will not be the 0 that is set at point 
5, but it will be the 0 that is set at point 5 + the 1 that was added at 
point 8 by the other template. Just like the session vars displayed at 
point 12 have been modified by the update at point 11.

Jochem

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

Reply via email to