global component to manage current users

Discussion in 'ASP .Net' started by wh, Nov 5, 2003.

  1. wh

    wh Guest

    The application that I'm about to start working on requires maintaining a
    list of users currently accessing an asp.net application running on IIS5.0.

    I essentially need to monitor which xml files on the server various users
    are working on. When a user selects an xml file, it is marked as 'locked'
    thus disallowing other users from modifying it. The users will come and go
    and I therefore need to remove the 'locked' flag from the respective xml
    files they were working on. (I assume I can add code to the Session_OnEnd
    event to remove locks from files caused by users not logging out properly).

    The number of users in the system is expected to be very few at a single
    time (maximum of 3).

    My idea is to have a global object that can be accessed by users from other
    sessions. It would provide an interface something similar to:

    myobject.LockXmlFile()
    myobject.ReadXmlFile()
    myobject.UnlockXmlFile()

    The object would then keep track of what xml file is being used by each user
    (via the Session ID). My question is what issues would I need to look at in
    terms of multiple pages accessing the global object at a single time? I
    understand that the component needs to be free threaded. Presumably I'd need
    to perform all locking inside the component to ensure there are no race
    conditions. Do I need to 'mark' the component as free threaded or does .Net
    assume that it is free threaded?

    I plan to create an instance of the global object in the
    Application_OnStart() event and store it in the HttpApplicationState object
    via the Application variable. I am aware that upon processing a request, the
    HttpRuntime selects an HttpApplication object from a resource pool. Would
    the global object I am creating be accessible from other HttpApplication
    objects used by requests from other users? All requests are being accessed
    in the same worker process though on different threads so I don't see a
    problem there - am I correct?

    Wayne.
    wh, Nov 5, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Nagy
    Replies:
    3
    Views:
    304
    Steven Nagy
    Apr 12, 2007
  2. Cirene

    Admin to manage users

    Cirene, May 23, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    328
    Cirene
    May 23, 2008
  3. Sravan
    Replies:
    0
    Views:
    229
    Sravan
    May 27, 2011
  4. Donald Adams

    How to manage users on deployed web server (.Net 2.0)

    Donald Adams, Feb 13, 2006, in forum: ASP .Net Security
    Replies:
    3
    Views:
    137
    Dominick Baier [DevelopMentor]
    Feb 14, 2006
  5. Wilmer Hernandez
    Replies:
    4
    Views:
    447
    Wilmer Hernandez
    Aug 20, 2007
Loading...

Share This Page