Re: Problem with asp.net app only allowing 1 user at a time
From: John M Deal (johndeal_at_necessitysoftware.com)
Date: 12/07/04
- Next message: niv: "deploying asp.net application"
- Previous message: nicholas: "Re: public variable does not keep it's value"
- In reply to: jsale: "Problem with asp.net app only allowing 1 user at a time"
- Next in thread: jsale: "Re: Problem with asp.net app only allowing 1 user at a time"
- Reply: jsale: "Re: Problem with asp.net app only allowing 1 user at a time"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: niv: "deploying asp.net application"
- Previous message: nicholas: "Re: public variable does not keep it's value"
- In reply to: jsale: "Problem with asp.net app only allowing 1 user at a time"
- Next in thread: jsale: "Re: Problem with asp.net app only allowing 1 user at a time"
- Reply: jsale: "Re: Problem with asp.net app only allowing 1 user at a time"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|