Okay, JIm, using this and your last suggestion, I have made a test case that I think points to the same issue that I was having in the beginning. Of course, the code that I have will run correctly. I agree that just testing for the "qry_get_topcats" var wasn't the right way to go...
Running the code below, I always get the result "MakeTree rides again" when I refresh the page, so it apparently seems like the module call is not modifying the cached query, it is just modifying the cached query, but dropping that modified query at the end of the request - right? I also see that make_tree.cfm is being called every time when I turn on debugging. Weird? Normal behavior? <cfquery name="qry_get_topcats" datasource="#Request.DS#" username="#Request.user#" password="#Request.pass#" cachedwithin="#Request.Cache#"> SELECT Category_ID, Name, Parent_ID, ParentIDs FROM Categories WHERE Categories.Display = 1 ORDER BY Priority, Name </cfquery> <cfif NOT IsDefined("qry_get_topcats.maketreesortlevel")> "MakeTree rides again" <cfmodule template="make_tree.cfm" Query="#qry_get_topcats#" Result="qry_get_topcats" Unique="category_ID" Parent="Parent_ID"> </cfif> Jim Davis wrote: >>-----Original Message----- >>From: Jim Davis [mailto:[EMAIL PROTECTED] >>Sent: Thursday, September 29, 2005 12:12 PM >>To: CF-Talk >>Subject: RE: ways to cache a query other than 'cachedwithin' >> >>Now I'm not so sure about that... but I think I'm still right. >> >>The queryname is definitely used as part of the key to the cached data... >>but since it's not in a permanent scope I don't see how it could be >>available to be checked (using IsDefined()) until the query is run. >> >>I think this needs some testing... > > > Do some testing... I think I'm correct. Run the following code (but change > the query to actually work on your system): > > <cfif IsDefined("MyQuery")> > Is Defined! > <cfelse> > Is NOT Defined! > </cfif> > <cfquery datasource="..." > name="MyQuery" > cachedwithin="1" > result="MyQueryInfo"> > SELECT ... > </cfquery> > <cfdump var="#MyQueryInfo#"> > > The first time you run it you'll see that "MyQuery" is not defined. The > Query metadata will show that in this instance it's not been cached. > > The second time you run it you'll see that "MyQuery" is still not defined... > but the metadata will show that the query was retrieved from cache. > > Hope this helps, > > Jim Davis > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219649 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54