Yeah - I do it this way sometimes (holding a lookup query of inventory for
example). Some times I do something like this:
<cfif NOT IsDefined('application.*somekey*') OR
IsDefined('url.forceRefresh')>
<cflock scope="application" timeout="10">
<cfquery name="application.Inventory" datasource="MyDsn">
SELECT * FROM inventory_table
</cfquery>
</cflock>
</cfif>
Then, I (or even my client) can just hit any page in the ap with
?forcerefresh=true appended to the URL - and viola! the application vars are
refreshed.
-mk
-----Original Message-----
From: Dowdell, Jason G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 10:26 AM
To: CF-Talk
Subject: RE: Flushing Application scoped vars
This is actually a shopping cart structure that displays the items
in each category, subcategory or brand. The structure only gets
deleted if the owner of the store updates the database of products
and then I set a flag. I knew about deleting and clearing the
structure but it wasn't working. I think my problem was that I
didn't get rid of the cookies on my machine but I'm checking that now.
~Jason
-----Original Message-----
From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 10:15 AM
To: CF-Talk
Subject: RE: Flushing Application scoped vars
Jason,
You could loop through the scope (it's a structure) and delete the keys -
they would be instantiated on the next request. Note: if you have to do
this routinely then you are probably using the wrong scope. the Ap scope
should be reserved for data that changes very rarely (like lookup queries or
Datasource names).
-mk
Mark A. Kruger, MCSE, CFG
www.cfwebtools.com
www.necfug.com
no more brochures!
-----Original Message-----
From: Dowdell, Jason G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 8:37 AM
To: CF-Talk
Subject: Flushing Application scoped vars
Does anyone know of a good way to flush the vars stored in the application
scope? I tried setting the applicationtimeout to CreateTimeSpan(0,0,0,0)
and
that didn't do anything. I'm not sure how cfflush works but I think that
has to
do with headers and not with ColdFusion cacheing. Anyway, if any of you has
a good tip for this I'd appreciate it.
Thanks,
Jason
<!---
Jason Dowdell
[EMAIL PROTECTED]
321.799.6845
IM AES - Web Developer
--->
______________________________________________________________________
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists