More HttpModules Strangeness
<httpModules>
<add name="UnitOfWorkModule"
type="Rhino.Commons.HttpModules.UnitOfWorkModule,
Rhino.Commons"/>
</httpModules>
But, if I put a break point on the Init() method in the Http Module, it is called twice! I run it many times, and the "secret" seems to be multiply requests in the application's start. It looks likes several HttpApplication instances are created, and this is what is causing the issue.
This may be related to the previous error, since my state is app-domain global. If the ASP.Net runtime initiate more than a single HttpApplication per app-domain, and clean it up after ward, it may cause the issues that I have seen, of Disposing an HttpModule which hold global state and then not calling the Init() again.
At the moment, I am going to assume that this is the case, which means that my life are ever more complicated than before.
At the moment, I am using a static variable to hold the container instance, but this static variable is shared among all the HttpApplication instances. This probably mean that I need to keep track of it in an Application level variable, but this gets into complicated code in non-web scenarios.
Comments
Comment preview