Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ColdFusion Server CFC Caching Issue

I develop coldFusion applications on my laptop with it's own ColdFusion 8 server with IIS which run on Windows Vista. I am having a rather annoying problem.

The problem is whenever I make any changes to my CFC's, it appears that unless I restart my ColdFusion Application server, the changes to my CFC's will not take effect unti I do so. Often times, I have to restart my whole machine because Windows can't restart the ColdFusion Application Server service. Is there a better way to reset the ColdFusion Server's cfc cache?

This is beginning to suck up a lot of time just having to restart every so often after I make a change. Any insight would be greatly appreciated!

Thank you!

like image 735
GavinWoods Avatar asked Feb 11 '10 21:02

GavinWoods


3 Answers

I guarantee you are creating these as objects in some sort of persistent scope, eg: application, session scopes. What I generally do to avoid this problem during development is create a url parameter and check for that in the application.cfm/cfc file (or wherever you are creating the objects) and recreate the objects if that url parameter is detected.

Example:

<cfif NOT structKeyExists(application,"myObj") OR structKeyExists(url,"reinit")>
    <cfset application.myObj = createObject("component","path.to.cfc") />
</cfif>

of course you would need to do this with every object that you are having a problem with.

like image 132
Ryan Guill Avatar answered Nov 15 '22 23:11

Ryan Guill


im not sure if this is in other versions of CF also but in CF9 you can do ApplicationStop() and it will reset the CFApplication and reload it.

like image 43
Faisal Abid Avatar answered Nov 15 '22 23:11

Faisal Abid


Uncheck "Component cache" in CFAdmin --> Caching

Also check CFAdmin --> Mappings and make sure the CFC folder is pointing to the right one if any. Sometimes people clone their source code and don't change the mapping to the new folder.

like image 1
chung lee Avatar answered Nov 15 '22 23:11

chung lee