[cfaussie] Re: Clear query cache
Thank you Raymond. I've tried the first one - it didn't work. I'll try the second one. Would you be able to give me an example how to put cache in the Application scope? Thanks, George 2008/11/13 Raymond Camden [EMAIL PROTECTED] You have two methods: 1) cfobjectcache action=clear This clears ALL cached queries on the entire box. 2) You can rerun the query with a timespan of 0,0,0,0. Note - the SQL must be the exact same, and that includes white space! Personally I cache my queries in the Application or Session scope. Makes it a lot easier to clear. On Wed, Nov 12, 2008 at 4:22 PM, George Lu [EMAIL PROTECTED] wrote: Hi, I've got a query in a CFC with a cache setting: cachedWithin=#CreateTimeSpan(7,0,0,0)#. I've updated the query but how can I clear or reset the cache so I can see the updated query result now? Thanks, George -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Clear query cache
cfset application.x = y There ya go. :) That assumes Y is a query. Here is a more fuller, but still a bit pseudo-code, example: cfif not structKeyExists(application,states) cfquery name=getStates datasource=foo select id, name from states /cfquery cfset application.states = getStates /cfif Obviously this could be wrapped up into a CFC. On Wed, Nov 12, 2008 at 4:43 PM, George Lu [EMAIL PROTECTED] wrote: Thank you Raymond. I've tried the first one - it didn't work. I'll try the second one. Would you be able to give me an example how to put cache in the Application scope? Thanks, George 2008/11/13 Raymond Camden [EMAIL PROTECTED] You have two methods: 1) cfobjectcache action=clear This clears ALL cached queries on the entire box. 2) You can rerun the query with a timespan of 0,0,0,0. Note - the SQL must be the exact same, and that includes white space! Personally I cache my queries in the Application or Session scope. Makes it a lot easier to clear. On Wed, Nov 12, 2008 at 4:22 PM, George Lu [EMAIL PROTECTED] wrote: Hi, I've got a query in a CFC with a cache setting: cachedWithin=#CreateTimeSpan(7,0,0,0)#. I've updated the query but how can I clear or reset the cache so I can see the updated query result now? Thanks, George -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Clear query cache
Thanks Raymond for the example. I'll incorporate it into my CFC. Well, I've tried the second method. It didn't work either. I'm using Flash Forms (I know, it's bit old :)) in the front end. Maybe I should use this in onRequestStart? cfif structKeyExists(url,updateapp) !--- cfset result = onApplicationEnd() / --- cfset result = onApplicationStart() / /cfif 2008/11/13 Raymond Camden [EMAIL PROTECTED] cfset application.x = y There ya go. :) That assumes Y is a query. Here is a more fuller, but still a bit pseudo-code, example: cfif not structKeyExists(application,states) cfquery name=getStates datasource=foo select id, name from states /cfquery cfset application.states = getStates /cfif Obviously this could be wrapped up into a CFC. On Wed, Nov 12, 2008 at 4:43 PM, George Lu [EMAIL PROTECTED] wrote: Thank you Raymond. I've tried the first one - it didn't work. I'll try the second one. Would you be able to give me an example how to put cache in the Application scope? Thanks, George 2008/11/13 Raymond Camden [EMAIL PROTECTED] You have two methods: 1) cfobjectcache action=clear This clears ALL cached queries on the entire box. 2) You can rerun the query with a timespan of 0,0,0,0. Note - the SQL must be the exact same, and that includes white space! Personally I cache my queries in the Application or Session scope. Makes it a lot easier to clear. On Wed, Nov 12, 2008 at 4:22 PM, George Lu [EMAIL PROTECTED] wrote: Hi, I've got a query in a CFC with a cache setting: cachedWithin=#CreateTimeSpan(7,0,0,0)#. I've updated the query but how can I clear or reset the cache so I can see the updated query result now? Thanks, George -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Clear query cache
It works now! I guess because I've put the cfc into the application scope and the query into the request scope. 2008/11/13 George Lu [EMAIL PROTECTED] Thanks Raymond for the example. I'll incorporate it into my CFC. Well, I've tried the second method. It didn't work either. I'm using Flash Forms (I know, it's bit old :)) in the front end. Maybe I should use this in onRequestStart? cfif structKeyExists(url,updateapp) !--- cfset result = onApplicationEnd() / --- cfset result = onApplicationStart() / /cfif 2008/11/13 Raymond Camden [EMAIL PROTECTED] cfset application.x = y There ya go. :) That assumes Y is a query. Here is a more fuller, but still a bit pseudo-code, example: cfif not structKeyExists(application,states) cfquery name=getStates datasource=foo select id, name from states /cfquery cfset application.states = getStates /cfif Obviously this could be wrapped up into a CFC. On Wed, Nov 12, 2008 at 4:43 PM, George Lu [EMAIL PROTECTED] wrote: Thank you Raymond. I've tried the first one - it didn't work. I'll try the second one. Would you be able to give me an example how to put cache in the Application scope? Thanks, George 2008/11/13 Raymond Camden [EMAIL PROTECTED] You have two methods: 1) cfobjectcache action=clear This clears ALL cached queries on the entire box. 2) You can rerun the query with a timespan of 0,0,0,0. Note - the SQL must be the exact same, and that includes white space! Personally I cache my queries in the Application or Session scope. Makes it a lot easier to clear. On Wed, Nov 12, 2008 at 4:22 PM, George Lu [EMAIL PROTECTED] wrote: Hi, I've got a query in a CFC with a cache setting: cachedWithin=#CreateTimeSpan(7,0,0,0)#. I've updated the query but how can I clear or reset the cache so I can see the updated query result now? Thanks, George -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Clear query cache
Any reason why you wouldn't just put that scope into the query name? As in: cfquery name=application.getStates datasource=foo Brett B) Raymond Camden wrote: cfset application.x = y There ya go. :) That assumes Y is a query. Here is a more fuller, but still a bit pseudo-code, example: cfif not structKeyExists(application,states) cfquery name=getStates datasource=foo select id, name from states /cfquery cfset application.states = getStates /cfif Obviously this could be wrapped up into a CFC. On Wed, Nov 12, 2008 at 4:43 PM, George Lu [EMAIL PROTECTED] wrote: Thank you Raymond. I've tried the first one - it didn't work. I'll try the second one. Would you be able to give me an example how to put cache in the Application scope? Thanks, George 2008/11/13 Raymond Camden [EMAIL PROTECTED] You have two methods: 1) cfobjectcache action=clear This clears ALL cached queries on the entire box. 2) You can rerun the query with a timespan of 0,0,0,0. Note - the SQL must be the exact same, and that includes white space! Personally I cache my queries in the Application or Session scope. Makes it a lot easier to clear. On Wed, Nov 12, 2008 at 4:22 PM, George Lu [EMAIL PROTECTED] wrote: Hi, I've got a query in a CFC with a cache setting: cachedWithin=#CreateTimeSpan(7,0,0,0)#. I've updated the query but how can I clear or reset the cache so I can see the updated query result now? Thanks, George -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org -- Brett Payne-Rhodes Eaglehawk Computing t: +61 (0)8 9371-0471 m: +61 (0)414 371 047 e: [EMAIL PROTECTED] w: http://www.yoursite.net.au --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: Clear query cache
I have the query getStates in the cfc: helpdeskGateway and create object for the cfc in application.cfc: cfset application.helpdeskGateway = createObject(component,variables.componentPath .components.HelpdeskGateway).init(variables.dns) / So when I access the query I use this: application.helpdeskGateway.getStates. As sometimes CF complains it couldn't find helpdeskGateway in the application scope so I've also put helpdeskGateway into the request scope. Hence when I want to access the query I use this: request.helpdeskGateway.getStates. I know this is not good but I don't know why. 2008/11/13 Brett Payne-Rhodes [EMAIL PROTECTED] Any reason why you wouldn't just put that scope into the query name? As in: cfquery name=application.getStates datasource=foo Brett B) Raymond Camden wrote: cfset application.x = y There ya go. :) That assumes Y is a query. Here is a more fuller, but still a bit pseudo-code, example: cfif not structKeyExists(application,states) cfquery name=getStates datasource=foo select id, name from states /cfquery cfset application.states = getStates /cfif Obviously this could be wrapped up into a CFC. On Wed, Nov 12, 2008 at 4:43 PM, George Lu [EMAIL PROTECTED] wrote: Thank you Raymond. I've tried the first one - it didn't work. I'll try the second one. Would you be able to give me an example how to put cache in the Application scope? Thanks, George 2008/11/13 Raymond Camden [EMAIL PROTECTED] You have two methods: 1) cfobjectcache action=clear This clears ALL cached queries on the entire box. 2) You can rerun the query with a timespan of 0,0,0,0. Note - the SQL must be the exact same, and that includes white space! Personally I cache my queries in the Application or Session scope. Makes it a lot easier to clear. On Wed, Nov 12, 2008 at 4:22 PM, George Lu [EMAIL PROTECTED] wrote: Hi, I've got a query in a CFC with a cache setting: cachedWithin=#CreateTimeSpan(7,0,0,0)#. I've updated the query but how can I clear or reset the cache so I can see the updated query result now? Thanks, George -- === Raymond Camden, VP of Software Dev, Broadchoice Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org -- Brett Payne-Rhodes Eaglehawk Computing t: +61 (0)8 9371-0471 m: +61 (0)414 371 047 e: [EMAIL PROTECTED] w: http://www.yoursite.net.au --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---