1 Reply Latest reply on Jun 15, 2006 3:47 PM by Newsgroup_User

    cfquery.executiontime can't be set as a local variable in an application scoped cfc

    shirai
      We've put the majority of our CFCs in the application scope.

      The problem is that when we access any function in the CFC that has a CFQUERY, the cfquery creates a variable named "cfquery.executiontime". This is like when you call CFFILE and it leaves behind a "cffile" struct.

      However, with cffile, we can use

      <cfset var cffile="">

      in the function and and that makes sure that the cffile is created local to the function and not in the application scope.

      The problem is that when we use

      <cfset var cfquery="">

      of

      <cfset var cfquery=structnew()>

      It still creates a "cfquery.executiontime" variable in the application scope.

      I think this may be leading to problems with garbage collection as our memory gets used up quickly. At any rate, it feels sloppy to leave it like this.

      I wrote a little script that goes through all our CFCs and looks for leaked variables in the application scope and cfquery is the only one I could find.

      Any help would be appreciate. Thanks.

      Sunny