Skip to main content
Participating Frequently
December 9, 2010
Question

losing application variables in CF8

  • December 9, 2010
  • 2 replies
  • 2206 views

I have the following issue. My  application has a single application.cfc (no application.cfm).  Application variables are consistently "disappearing," i.e., becoming  undefined. This is generating runtime errors after minimal user  activity. If the server is rebooted, the variables persist for a very  short time (a few minutes) and then are undefined again.At what time the  variables "disappear" appears to be random.

The server is a ColdFusion  Enterprise server (CF 8).

Does  anyone know why application variables would suddenly go from being  defined to undefined within the same user visit? Is there any "side  effect" of built-in CF functions or tags which could cause this behavior  unexpectedly?

Thanks.

    This topic has been closed for replies.

    2 replies

    Inspiring
    December 9, 2010

    In short: nope.

    Do you any stray Application.cf(c|m) files around?

    Are you doing some sort of "variable clearance" that might not consider "pass by reference" issues, or something?

    Hard to tell.

    --

    Adam

    Participating Frequently
    December 9, 2010

    There is only one application.cfc. No other application.* file. We did a search of all directories.

    I don't understand the second question about variable clearance, but if you mean this: (1) we have a struct; (2) we pass it to a function; (3) the function clears it, then no, that's not happening. I understand struct's are passed as references in CF, so we aren't doing that. We never clear out the application struct.

    Participating Frequently
    December 9, 2010

    And you're absolutely certain that the server isn't crashing/restarting without your knowledge?  I'd try Josh's suggestion.  I'd also put some logging in onApplicationEnd.  I'd also check my application/exception/server logs.

    Participating Frequently
    December 9, 2010

    Do you have an application name that is also used by another website on the

    same server perhaps? Try making it very unique.

    Participating Frequently
    December 9, 2010

    Good idea, but this is the ONLY application on the server. And the name is very unique. Any other ideas? Also, even when usage is restricted to is restricted to a single user, the issue arises.

    Participating Frequently
    December 9, 2010

    Could you be setting application variables outside of the Application.cfc and the application times out?  If so the variable will become undefined until the other template runs and sets it.  What is your app timeout?  How heavily trafficed is the app?