Re: static class confirmation
- From: "scott blood" <scott_blood@xxxxxxxxxxx>
- Date: Wed, 15 Mar 2006 11:42:55 -0000
I think your right there, i just tried this on one of our IIS servers and
the same behaviour appeared.
I think because the connection string is not changing asp.net is intellegent
enough not to need to recreate the class for multiple users.
If you actually change the ConnectionString property and then push this out
to your live server, all users on your server will actually be forced to
refresh there current session and all there Session variables are cleared.
This is actually quite clever and will be changing a number of things on our
own website to take this behaviour into account.
Regards
"Steven Blair" <steven.blair@xxxxxxxxxxxxxx> wrote in message
news:eF$BRSCSGHA.4792@xxxxxxxxxxxxxxxxxxxxxxx
Using ASP.NET 2.0 and Visual Studio 2005
I have website and a DLL attached to it (BusLayer). The class inside the
dll (also imaginatively named BusLayer) havea number of static
variables. One example:
public static connectionString;
Website is running from IIS.
Am I right in saying that this BusLayer class is shared amongst ALL
intances of my website. If I access the site from my PC, and a friend
accesses from a different PC, then we are using the same variable called
connectionString?
I ran a test and put a line of trace in the static constructor (the
whole class is static) and this line was only written out once, even
when I had multiple users access my site.
Thanks in advance.
Steven
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: static class confirmation
- From: Ignacio Machin \( .NET/ C# MVP \)
- Re: static class confirmation
- From: Steven Blair
- Re: static class confirmation
- From: Steven Blair
- Re: static class confirmation
- References:
- static class confirmation
- From: Steven Blair
- static class confirmation
- Prev by Date: Re: Dynamically changing HTML in page beofore output to user
- Next by Date: Re: Forevery() writable iterator mechanism in C# 3
- Previous by thread: static class confirmation
- Next by thread: Re: static class confirmation
- Index(es):
Relevant Pages
|