This was a bad idea pre-MX because of locking issues... i.e. You wouldn't want to use <cflock scope="session"><cfquery name="session.myquery"></cfquery></cflock> because the query is going to take a lot longer to complete than <cfset session.myquery = myquery> and you wouldn't want to leave the reference to the session variable unlocked, so although it was possible to use name="session.myquery" it wasn't adviseable.
s. isaac dealey 954-776-0046 new epoch http://www.turnkey.to lead architect, tapestry cms http://products.turnkey.to certified advanced coldfusion 5 developer http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 > ive never seen naming a query in the session scope....thats definitely a > new one one me. > ..tony > Tony Weeg > Senior Web Developer > Information System Design > Navtrak, Inc. > Fleet Management Solutions > www.navtrak.net > 410.548.2337 > -----Original Message----- > From: Simon Stanlake [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, November 27, 2002 1:04 PM > To: CF-Talk > Subject: sessionquery.recordcount > hi, > we have the following code... > <cfquery name="session.myResults" datasource="#request.ds#"> > select * > from theTable > </cfquery> > <!--- create an array of 1's to use in queryAddColumn ---> > <cfset defaultValueArray = ArrayNew(1)> > <cfloop index="i" from="1" to="#session.myResults.recordCount#"> > <cfset defaultValueArray[i] = 1> > </cfloop> > occasionally, we exit this piece of code and the length of the array is > different from the length of the query. ie: > arraylen(defaultValueArray) != session.myResults.recordCount. > It seems to me that this should never happen. > I've changed the name of the table and the session variable, but > otherwise > the code is a cut-and-paste. I realize there are a bunch of different > ways > to do this, but I want to know what causes this behaviour. Has anyone > else > seen something similar? recordcount not always returning the right > value? > cfloop bailing out early? funniness when storing queries in the session > scope? > thanks, > simon > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.