Using ISIBernate ISession and Thread Safety

When I set my ISession service time to an "HTTP request" (the instance of Autofac instance that I use), the NHibernate profiler tells me that my session is being used on threads, which is most likely an error. What's happening? I'm used to thinking that I should have a unit of work for the http request, but it seems that the session is actually being used through threds.

Essentially, this ISession per HTTP request conflicts with NHibernate profiler warnings. Where am I mistaken?

UPDATE: I have a ContainerDisposalModule container in my Web.config, so the recycling works as it should

+3
source share
1 answer

IIS (like most web servers) uses multiple threads to serve requests, so this is probably not an error in your application, and you can safely ignore warnings.

See also this question .

+1
source

Source: https://habr.com/ru/post/1772455/


All Articles