473,769 Members | 5,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

global component to manage current users

wh
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.LockXm lFile()
myobject.ReadXm lFile()
myobject.Unlock XmlFile()

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_OnS tart() event and store it in the HttpApplication State 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.
Nov 17 '05 #1
0 1051

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
66084
by: Daniel Bass | last post by:
how do i declare a global variable in c#.net? it's like it want's everything in classes... there are times when globals are good, like having constants in a program which apply to several layers/objects/etc... or does it expect me to create a singleton global class structure? surely it's not that terrible.
5
3943
by: WJ | last post by:
I am attempting to use the Global.Asax to store my user's configuration. Here is the concept: 1. User logs on into the site using Form Authentication. 2. I capture the user Credential, verify it and then assign this Logon ID (user) a so called User's serverside cookie. 3. My system is configured to accept 1,024 concurrent users, this means that my Global.Asax will host no more than 1,024 Logon IDs and their associated cookies/variables....
0
1295
by: Tim::.. | last post by:
Hi, Can someone please tell me why I get this error when I try to build my ASP.NET application??? Could not load type 'CPNNet.Global'. Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="CPNiNet.Global" %> Thanks for any help!
6
4243
by: Anders J | last post by:
Hi We have some code that runs in a EventReceiver ItemAdded handler. The code must be thread-safe since it is iterating a List to find the max number of a column and assigns it + 1 to the Item that was added. If it was not thread-safe, two items could get the same number (which must be unique). So how do we garantee this in the event handler? Is locking on "this" enough? I guess not since other types of Event Handlers could as well...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10222
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10050
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9999
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.