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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. asp.net singleton class

asp.net singleton class

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasewindows-adminhelp
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.
  • S Offline
    S Offline
    Syed M Hussain
    wrote on last edited by
    #1

    Hi guys Hope someone can help with a question, Im not an asp.net developer so please bare with me. I created a very simple Singleton class, that is, its not thread safe. Now I would have though that the singleton class instance would only exist for a single page request. What I am finding is that my test singleton instance persists over several http requests. I wanted to develop a very small cms with a single db instance that exists only for each page request. So really my question is how does IIS keep the singleton instance alive for several page requests. :omg:

    J 1 Reply Last reply
    0
    • S Syed M Hussain

      Hi guys Hope someone can help with a question, Im not an asp.net developer so please bare with me. I created a very simple Singleton class, that is, its not thread safe. Now I would have though that the singleton class instance would only exist for a single page request. What I am finding is that my test singleton instance persists over several http requests. I wanted to develop a very small cms with a single db instance that exists only for each page request. So really my question is how does IIS keep the singleton instance alive for several page requests. :omg:

      J Offline
      J Offline
      jkirkerx
      wrote on last edited by
      #2

      You may want to remove the form tags from you page, to indicate that the page is a 1 way trip, with no postback capabilties.

      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