Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Application Variable dissappearing

Application Variable dissappearing

Scheduled Pinned Locked Moved ASP.NET
databasehelpcsharpsysadminquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    markymark82
    wrote on last edited by
    #1

    Hello all, Not sure if anyone has seen or heard of this problem before, but it has me stumped and google has failed to help in my search for an answer so far... I am trying to use a couple of Application Variables on my site, but they keep disappearing. I am storing the values I want them to hold in a config table in an SQL Db, then on application start I fetch the config values and turn them into Application variables so that I don't need everyone connecting to the db each time they need to be used which is very frequently. I know making changes to the web.config file restarts the application, and that's not what's causing the problem. No class files are being changed or even pages updated, and yet the application variables just vanish, sometimes twice a day, sometimes once a week. I have written an admin page to reset the varibles so it can be done nice and quickly, but I can't seem to find out what the problem is, I only seem to get it on my live server, not my test one. it's a Win 2003 box and the sites .net 3.5 if that helps at all? Any help/advice would be appreciated. Thanks in advance mark

    D 1 Reply Last reply
    0
    • M markymark82

      Hello all, Not sure if anyone has seen or heard of this problem before, but it has me stumped and google has failed to help in my search for an answer so far... I am trying to use a couple of Application Variables on my site, but they keep disappearing. I am storing the values I want them to hold in a config table in an SQL Db, then on application start I fetch the config values and turn them into Application variables so that I don't need everyone connecting to the db each time they need to be used which is very frequently. I know making changes to the web.config file restarts the application, and that's not what's causing the problem. No class files are being changed or even pages updated, and yet the application variables just vanish, sometimes twice a day, sometimes once a week. I have written an admin page to reset the varibles so it can be done nice and quickly, but I can't seem to find out what the problem is, I only seem to get it on my live server, not my test one. it's a Win 2003 box and the sites .net 3.5 if that helps at all? Any help/advice would be appreciated. Thanks in advance mark

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      Check if your application variable getting lost coincides with IIS worker process recycling. IIS Worker process gets recycled based on various conditions like number of inputs serviced, time to live, etc and is configurable. But, it has to be recycles no matter what. If this is the case then, it explains why you do not face this on your test server, since the no of hits on your test server is nowhere near what you get on the Live server. The solution for your problem would be to use a sliding expiration scheme to auto expire/refresh the data on a time bound/unavailability basis. Alternatively, you can also modify the get property of the application variable to check if the data is available and fetch it from the server if it is not available. Doing this would ensure that your application does not fail and there is no need for manual intervention. HTH! Have a Great Year ahead!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups