entity framework - Unity singleton multiple request access ASP.Net MVC 5 -


i using mvc5 , unity. little confused reading thread safe singletons. multiple users share same singleton object? understanding singleton object created every request , 2 users each have own singleton. correct?

[update]

let have singleton class property instance instance. 2 users accessing website @ same time accessing same singleton object when calling instance? scope of object? scope shared among multiple users or every user have own scope? instance return same object both users?

it depends on exact lifetime manager use. if "singleton" mean container controlled lifetime manager, instance shared users , not created lifetime of request.

on other hand, per http context lifetime managers expect.

neither has "singleton" in name, though.

http://msdn.microsoft.com/en-us/library/ff647854.aspx

http://msdn.microsoft.com/en-us/library/microsoft.practices.unity.perrequestlifetimemanager(v=pandp.30).aspx


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -