Applkications, appdomains and singletons

M

mortb

Hi,

If I want to implement a singleton using a class that has a static variable
containing the singleton object, can I guarantee that it will be a singleton
to my entire webapplication on a single webserver or may the webapplication
be loaded into several appdomains?

cheers,
mortb
 
M

Michael Nemtsev

Hello mortb,

See this http://www.codeproject.com/dotnet/remotingsingleton.asp

Btw, You can keep your singleton in Cache with CacheItemPriority.NotRemovable,
but you need to consider using some ways for the reliable cache in webfarms,
to have the single instance among all nodes

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

m> Hi,
m>
m> If I want to implement a singleton using a class that has a static
m> variable containing the singleton object, can I guarantee that it
m> will be a singleton to my entire webapplication on a single webserver
m> or may the webapplication be loaded into several appdomains?
m>
m> cheers,
m> mortb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top