Re: Problem with asp.net app only allowing 1 user at a time

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John M Deal (johndeal_at_necessitysoftware.com)
Date: 12/07/04


Date: Tue, 07 Dec 2004 06:37:34 -0800

If I'm understanding you correctly you are loading data for the user
from the database then storing that data into application scope. The
issue that you then have is that you retrieve this data from application
scope the next time the page is displayed. If this is the case then you
should modify the way you are handling state management.

The Application object should only be used to store data that is truly
global to every user of the application. If you need to store things on
a per user basis you should look into using the Session object. Using
the Session object will allow you to store data classes on a per user
basis.

If you are worried about running the same query against the database
multiple times, then you might want to abstract the use of the
Application object (not a bad idea in general anyway) so that you can
store a collection of query result sets keyed by the query used, then
retrieve the appropriate result set for each user from the collection.
If the collection doesn't contain the appropriate result set then you
query the database and then add it to the collection and put the
collection back in Application scope. Once you retrieve the appropriate
result set from the application collection you could then put it in the
user's Session object and continue your retrieval from there.

Without more information on how you really intend to use these objects
it is hard to know which solution to use, but hopefully something from
the above will work for you.

Have A Better One!

John M Deal, MCP
Necessity Software

jsale wrote:
> I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app
> i have made is running on IIS v6 and consists of a number of pages that allow
> the user to read information from the database into classes, which are used
> throughout the application. I have made class collections which, upon reading
> from the DB, create an instance of the class and store the DB values in
> there temporarily. My problem is that if user1 looks at record1, then user2
> looks at record2, anything user1 does from that point onwards points the data
> at record2.
> Is there anything in particular i need to do to make the asp.net application
> available to multiple users at the same time, each looking at different
> records in the DB?
> Thanks in advance



Relevant Pages

  • Re: Problem with asp.net app only allowing 1 user at a time
    ... I've got a module that houses many functions that all retrieve information ... i am taking a snapshot of the database at that ... If you need to store things on ... > a per user basis you should look into using the Session object. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Complex Querie
    ... I have a database that we are currently using as order tracking. ... gets entered on the day it was ordered, and we store an "Order Date" field ... it is beyond my scope of expertise). ...
    (microsoft.public.access.queries)
  • Re: public and private mailboxes randomly dismounting
    ... When posting logs an important piece is the Event ID and Source. ... Information Store First Storage Group: An attempt to move the file ... An error occurred while writing to the database log file of storage group ...
    (microsoft.public.windows.server.sbs)
  • Re: cant mount information store
    ... I then reinstalled exchange and then installed exchange 2003 ... Information Store First Storage Group: Database recovery failed ... Microsoft Exchange Information Store. ...
    (microsoft.public.windows.server.sbs)
  • Re: Many Exchange errors!
    ... Event Source: ESE ... Information Store First Storage Group: An attempt to move the file ... An error occurred while writing to the database log file of storage group ...
    (microsoft.public.windows.server.sbs)