Doubts about application variables

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Doubts about application variables

    Hi.

    Reading some Microsoft materials about asp.net I came into two doubts.

    The following sentence is found on the topic "Application State" in the
    NET Framework documentation:

    "Calling Lock on the Application object causes ASP.NET to block attempts
    by code running on other worker threads to access anything in
    application state"

    So, if I use Lock this way:

    Application.Lock()
    Application("myVar") = 10
    Application.UnLock()

    All the other application variables on my system are blocked too?


    My second doubt relates to a sentence found on one of the Microsoft
    asp.net official courses:
    The topic about application variables says:

    "The Application object is destroyed when all users have exited the Web
    application and the Web
    application is then unloaded."

    To test this, I created some application variables in an asp.net
    application, load them and then exited the application. When I run the
    application again, the application variables are still there with the
    more recent values. It seems to me that application variables are only
    destroyed when their host is destroyed, in this case, the IIS process.
    Can anyone help me to understand the above sentence?

    Regards,

    Chris Leffer



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Chris Leffer Guest

  2. Similar Questions and Discussions

    1. Problem with Application variables using Application.cfc
      Hi guys, I'm using CFMX7 and with that the Application.cfc. I've defined the app variables using <cfset This.varname = "something"> I would like...
    2. DB Field name="application" and Application scope variables
      Hi, There is DB Field application which overwrited ,as I see , Application scope variable Are there way to solve this problem without using...
    3. Help, .NET doubts.....
      I have client sever application my client is windows based thin application and server has webService running. Right now Server serialized the data...
    4. ASP Application Variables
      I am using IIS 6.0 and am trying to use application variables to track uasge. They work fine as long as there is an active client but about 20...
    5. Global variables - application variables vs include file
      What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include...
  3. #2

    Default Re: Doubts about application variables

    When you call Application.Lock and Application.Unlock, they are applied
    only to the application variable in the current context.

    The application state/variables are destroyed when the web application
    is specifically unloaded..means stopping the IIS or web
    application..Even if there are no active users accessing the web server,
    the application state/variables are preserved until the web application
    is stopped...that is how we generally keep track of the number of
    visitors to a particualr web site.

    Hope this helps...

    --Rao
    Rao Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139