Sergey Metlov
Sergey Metlov

Reputation: 26311

Web service instance creation

Is web service instance creates for every request? Can I declare field in web service and be sure, that it will not be intersected for different users?

Upvotes: 1

Views: 212

Answers (1)

Sergey
Sergey

Reputation: 769

If you mean ASP.NET then the threads are reused so if you declare a variable threadlocal it is still accessible in different requests. You can use HttpContext.Current.Items for per-request storage.

Upvotes: 1

Related Questions