.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification