Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I read about AppDomain, but didn't get something.
Assume I have 2 sites A & B. For each site the VirtualDirectory was created in IIS6+. Both sites are under the same ApplicationPool.
I have case with 2 scenarios with questions. Answer please on each question in each scenario.

Case:
Request hits IIS for site A. AppDomain is created in ApplicationPool. Appropriate HttpApplication is created in that AppDomain and request is processed.
Scenario1:
Additional request hits IIS for site A. New AppDomain is created and in this new AppDomain HttpApplication is created OR HttpApplication is created in the 1st AppDomain(that was created for 1st Request)?

Scenario2:
Additional request hits IIS BUT for site B. New AppDomain is created and in this new AppDomain HttpApplication is created OR HttpApplication is created in the 1st AppDomain(that was created for 1st Request)?

Thank you
Posted

1 solution

Thats a very good Questtion. I'll try to answer both the scenario.
TheAteist wrote:
Additional request hits IIS for site A. New AppDomain is created and in this new AppDomain HttpApplication is created OR HttpApplication is created in the 1st AppDomain(that was created for 1st Request)


If application domain is already there, then it will be used for other request as well.Same HttpApplication class can be used for multiple request.


TheAteist wrote:
Additional request hits IIS BUT for site B. New AppDomain is created and in this new AppDomain HttpApplication is created OR HttpApplication is created in the 1st AppDomain(that was created for 1st Request)?


No, HTTPApplication is confined into app domain. HTTPApplication object of one site cannot be used by another website.
 
Share this answer
 
Comments
TheAteist 21-Oct-10 13:57pm    
Regarding the answer to 1st scenario:
I saw with reflector that HttpApplication is created by HttpApplicationFactory and there is the checking if HttpApplication instances doesn't exceed the maxNumber of HttpApplication instances. So, if 1 HttpApplication can handle all requests, so why there are limitation to HttpApplication instances if only 1 HttpApplication is needed to handle requests?

Thank you
Brij 21-Oct-10 14:43pm    
At a time single HttpApplication object handles a single request, it may need multiple objects, to cater multiple requests at single point of time. New object is only created when, there is no object or no one is free
TheAteist 24-Oct-10 7:41am    
"... it may need multiple objects..." - does "it" refer to "HttpApplication"? If it does, so what "multiple objects" do you talking about?
Alok Kr Sharma 24-Oct-10 7:49am    
I mean to say, to handle multiple request at a single point of time, multiple HTTPApplication's object are required. New object is only created when, there is no HTTPApplication object or no HTTPApplication object is free
TheAteist 25-Oct-10 3:44am    
I thought you meant that single HTTPApplication object can handle multiply requests at a single point of time(asynchronously). But now I think I get it.
HTTPApplication object can handle only ONE request at a single point of time and when it(HTTPApplication object) finished, so the SAME HTTPApplication object can handle another request, right?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900