Search:
Namespaces
Discussions
.NET v1.1
Feedback
Application context performance?
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.framework.aspnet
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...
Stephane (VIP)
Hi,
I was wondering if it's a good thing to use the web server application
context to manage a entire web site.
Here's my situation:
I built a server using .Net remoting. This is running as a windows service.
Then, my web application connect to this server via web services. The server
is not much than
ArrayList
of ArrayLists. For example, I got an
ArrayList
of
customers and each of those customers have an
ArrayList
of visitors,
themselves having an
ArrayList
of web pages visited...
Would the performance be equal if I had used application context? I would
have to use application.lock and application.unlock many times because thoses
lists might be accessed concurrently. What if I create a new object in the
application context for each customer? Could the web server support as many
as 100 customers?
What are the application context performances and limits?
If I could to this with application context, it would be less trouble than
using .Net remoting but I'm not sure the performance would be improved...
Thanks for your help.
Stephane
Reply to this message...
Carl Prothman [MVP] (VIP)
Stephane wrote:
[Original message clipped]
Stephane,
HttpApplication
.Context property gets HTTP-specific information
about the current request. Hence the context variable only exists for
the life of the request, which very short.
I think you are better off saving each customer's information in thier
own Session variable.
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebHttpApplicationClassSessionTopic.asp
Plus you should call the Web Service asynchronousy.
http://msdn.microsoft.com/library/en-us/dnservice/html/service09032002.asp
--
Thanks,
Carl Prothman
Microsoft ASP.NET MVP
Hire top-notch developers at
http://www.able-consulting.com
Reply to this message...
Stephane (VIP)
Thanks,
Maybe I wasn't clear enough (english is my second language!)
What I meant is instead of using a .Net remoting service, is it possible to
store an
ArrayList
in the application object in my ASP.NET web page like this:
Application["someCustomer"] = new
ArrayList
();
and this for as many customers as I need.
What kind of performance could I expect since I'd have to use many locks and
unlocks?
Thanks,
Stephane
"Carl Prothman [MVP]" wrote:
[Original message clipped]
Reply to this message...
Carl Prothman [MVP] (VIP)
Stephane wrote:
[Original message clipped]
No worries... ;-)
[Original message clipped]
Make the
ArrayList
customer specific and store it in Session
Session["CustomerArray"] = new
ArrayList
();
Remember to check to see if the Session variable is not null
before pulling the value out (since Session can timeout, and
hence the variables go away).
Application variables are for the life of the application and
should be filled apon application start up.
You will have poor performance if you try to have all users
update a single Application variable.
--
Thanks,
Carl Prothman
Microsoft ASP.NET MVP
Hire top-notch developers at
http://www.able-consulting.com
Reply to this message...
System.Collections.ArrayList
System.Web.HttpApplication
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com