try locking ALL session variables, reading AND writing.
-----Original Message----- From: Nathan Stanford [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 10:10 AM To: CF-Talk Subject: NEW (ColdFusion MX or ColdFusion 4.5) and Session Variables (Bug) Ok Ok... Tested on ColdFusion MX on a Solaris 7 with Apache 1.3.26 Web Server ColdFusion 4.5 on Windows NT with IIS Web Server Both when hitting refresh after the page is already running the session.cartquantity becomes inaccurate at a different rate... if I hit refresh a short time the error is small if I hit refresh a longer time into the code the error is greater. The Loop was put in to simulate the slow speed of the page while connected to the AS400. What should I test next?? I am all ears? well as much as I can be... I even put some locks around where I am setting the session variables to something. It looks like it is not rerunning the page from the top when I hit refresh. -------------- Code -------------- <cfapplication name="test" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0, 3, 0, 0)#"> <cfif IsDefined( "Cookie.CFID" ) AND IsDefined( "Cookie.CFTOKEN" )> <cfset localCFID = Cookie.CFID> <cfset localCFTOKEN = Cookie.CFTOKEN> <cfcookie name="CFID" value="#localCFID#"> <cfcookie name="CFTOKEN" value="#localCFTOKEN#"> </cfif> <cfset request.dsnSQL ="XXX"> <cfset request.dsnAS400 ="XXXX"> <cfset session.dealer_id="XXXXX"> <cflock timeout = "60" scope = "SESSION" type = "Exclusive"> <cfset session.cartquantity=0> </cflock> <cflock timeout = "60" scope = "SESSION" type = "Exclusive"> <cfset session.carttotal=0> </cflock> <cfoutput>Before Everything:<br> Session.Carttotal:#session.carttotal#<br> Session.CartQuantity:#session.cartquantity#<br><br> </cfoutput> <cfquery name="qry_checkoutcart" datasource="#request.dsnSQL#"> SELECT * FROM OreckDealerCart WHERE OreckDealer_id = #session.dealer_id# </cfquery> <cfquery name="qry_checkoutcart1" datasource="#request.dsnSQL#"> select sum(quantity) As CartTotal FROM OreckDealerCart WHERE OreckDealer_id = #session.dealer_id# </cfquery> <cfif qry_checkoutcart.recordcount eq 0> <cfelse> <cfset counter=0> <cfoutput>Before Query:<br> Session.Carttotal:#session.carttotal#<br> Session.CartQuantity:#session.cartquantity#<br><br> </cfoutput> <br> <cfoutput query="qry_checkoutcart"> In Query: Session.Carttotal:#session.carttotal#<br> Session.CartQuantity:#session.cartquantity#<br><br> <cfset y=1> <cfloop index="x" from="1" to="10000"> <cfset y=x*y> </cfloop> Quantity 1:#quantity# <!--- Good To Here ---> <!--- Bad here ---> <cflock timeout = "60" scope = "SESSION" type = "Exclusive"> <cfset session.cartquantity=#session.cartquantity#+#quantity#> </cflock> Session.CartQuantity:#session.cartquantity# Quantity 2:#quantity#<br><br> </cfoutput> <cfoutput> <a href="index.cfm?fuseaction=checkout"><img src="/oreckdealer/images/icons/dealer_cart.gif" border="0" alt="View Cart"></a> #session.cartquantity# Items #dollarformat(session.carttotal)# Total </cfoutput> </cfif> <br> > -----Original Message----- > From: Stacy Young [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 8:51 AM > To: CF-Talk > Subject: RE: ColdFusion MX and Session Variables (Bug) > > > We are and have been using session scope heavily. I can't say > I've seen this > problem yet...will let you know...we're about to QA our first > MX project. > > Stace > > -----Original Message----- > From: Nathan Stanford [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 8:56 AM > To: CF-Talk > Subject: RE: ColdFusion MX and Session Variables (Bug) > > > -----Original Message----- > > From: Jon Hall [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, July 24, 2002 4:19 PM > > To: CF-Talk > > Subject: Re: ColdFusion MX and Session Variables > > > > > > What about that session.dealer_id? > > Yes when adding Testing Variables the out put stayed the same. > > Is it staying consistent? What > > about the actual data? Is there some other query somewhere writing > > data that is affecting the price and or quantity variables, which I > > assume are coming from the qry_checkoutcart query, but I'm not sure, > > because they aren't scoped...hint hint :) > > They are not scoped because there is a AS400 Query and they can not be > scoped because there is no resultset coming back from the > AS400. Price is > not coming from qry_checkoutcart but I guess I could go scope > quantity. We > have tried several drivers with ColdFusion MX on a Solaris 7 > with Apache > 1.3.26 Web Server. When we tried the same thing on the NT it > seemed to be > fine. We even created a test page outside the application to > verify it was > not linked to any other page. > > > Who out there is working on a Solaris 7 with ColdFusion and Apache? > > > Testing Code Below > ==================================================================== > > <cfset request.cartquantity=0> > <cfset request.carttotal=0> > > <cfquery name="qry_checkoutcart" datasource="#request.dsnSQL#"> > SELECT * > FROM OreckDealerCart > WHERE OreckDealer_id = #session.dealer_id# > </cfquery> > > <cfif qry_checkoutcart.recordcount eq 0> > > <cfelse> > > <cfset counter=0> > <cfoutput query="qry_checkoutcart"> > > > <!--- removed AS400 Query here to get the PRICE ---> > > > > <cfset price = price*100> > <cfset subtotal=#price#*#qry_checkoutcart.quantity#> > <cfset request.carttotal=#request.carttotal#+#subtotal#> > <cfset > request.cartquantity=#request.cartquantity#+#qry_checkoutcart. > quantity#> > > > <!--- > STILL WORKING HERE: > ====================== > ---> > #session.dealer_id#<br> > #session.carttotal#<br> > #session.cartquantity#<br> > #price# X #quantity# = #subtotal#<br> > > </cfoutput> > <cfoutput> > <a href="index.cfm?fuseaction=checkout"> > <img src="/oreckdealer/images/icons/dealer_cart.gif" border="0" > alt="View Cart"> > </a> > > <!--- > WRONG INFORMATION COMES OUT HERE: > ---> > #session.cartquantity# Items > #dollarformat(session.carttotal)# Total > > </cfoutput> > > </cfif> > > > > > > > > > > > > -- > > Jon > > mailto:[EMAIL PROTECTED] > > ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.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