473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

What is the life expectancy of static hashtable

Using ASP.net, C# and a static class, does the following from MSDN mean:

1. a static hashtable would only live during the session and end when the
session ends

2. there would be a different static hashtable for each session
++ from MSDN ++

Static Variables - Lifetime

Extension of Lifetime
If a local variable is declared with the Static keyword, its lifetime is
longer than the execution time of the procedure in which it is declared. If
the procedure is inside a module, the static variable survives as long as
your application continues running.

If a static variable is declared in a procedure inside a class, the
variable's lifetime depends on whether the procedure is shared. If the
procedure is declared with the Shared keyword, the variable's lifetime
continues until your application terminates. If the procedure is nonshared,
its static variables are instance members of the class, and their lifetimes
are the same as that of the class instance.
++ end ++
Thank you,

John
May 21 '06 #1
2 1777
No. There will be one static hashtable across all sessions until the
application terminates.

Eliyahu

"xzzy" <mr********@comcast.net> wrote in message
news:ne******************************@comcast.com. ..
Using ASP.net, C# and a static class, does the following from MSDN mean:

1. a static hashtable would only live during the session and end when
the
session ends

2. there would be a different static hashtable for each session
++ from MSDN ++

Static Variables - Lifetime

Extension of Lifetime
If a local variable is declared with the Static keyword, its lifetime is
longer than the execution time of the procedure in which it is declared.
If
the procedure is inside a module, the static variable survives as long as
your application continues running.

If a static variable is declared in a procedure inside a class, the
variable's lifetime depends on whether the procedure is shared. If the
procedure is declared with the Shared keyword, the variable's lifetime
continues until your application terminates. If the procedure is
nonshared,
its static variables are instance members of the class, and their
lifetimes
are the same as that of the class instance.
++ end ++
Thank you,

John

May 21 '06 #2
And remember, this is in dog years.

--
;-),

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:Ol****************@TK2MSFTNGP02.phx.gbl...
No. There will be one static hashtable across all sessions until the
application terminates.

Eliyahu

"xzzy" <mr********@comcast.net> wrote in message
news:ne******************************@comcast.com. ..
Using ASP.net, C# and a static class, does the following from MSDN mean:

1. a static hashtable would only live during the session and end when
the
session ends

2. there would be a different static hashtable for each session
++ from MSDN ++

Static Variables - Lifetime

Extension of Lifetime
If a local variable is declared with the Static keyword, its lifetime is
longer than the execution time of the procedure in which it is declared.
If
the procedure is inside a module, the static variable survives as long as
your application continues running.

If a static variable is declared in a procedure inside a class, the
variable's lifetime depends on whether the procedure is shared. If the
procedure is declared with the Shared keyword, the variable's lifetime
continues until your application terminates. If the procedure is
nonshared,
its static variables are instance members of the class, and their
lifetimes
are the same as that of the class instance.
++ end ++
Thank you,

John


May 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Chris Capel | last post by:
What is the rationale behind the decision not to allow abstract static class members? It doesn't seem like it's a logically contradictory concept, or that the implementation would be difficult or...
5
by: Mountain Bikn' Guy | last post by:
How would I do this? public sealed class UtilityClass { public static MyObject Object1;//see note below about importance of static object names in this class public static MyObject Object2;...
6
by: Victor Hadianto | last post by:
Hi All, I'm a beginner with ASP.Net so please bear with me. I'm having difficulties trying to understand the behaviour of static variable across multiple ASP.Net page. My static variable is a...
7
by: SevDer | last post by:
Hi We have a static hashtable that is located in another tier in our n-tiered web application. And we are storing big but not huge objects in this hashtable and the key to the objects is...
2
by: Brian | last post by:
How static are static variables in ASP.NET? This is not a real example, but it's good enough to make the point. Say I have a custom control with a dictionary. The dictionary is composed of...
1
by: Marek Wierzbicki | last post by:
In my MSSQL server 2000 sp4, in performanece monito, buffer memory, page life expectancy is equal to 0.00000 (average for 10 sec, auto update). I think sth is wrong configured, but what? Marek
5
by: evaristobo | last post by:
i'm a bit confused here, a pointer is something aiming to an object, but a static class is not an object, nevertheless i would like to have the possibility of doing something like handling an...
14
by: Mark S. | last post by:
Hello, I've written a high performance web app with C# and it completely relies on static hash tables (using sync) and classes. Under real world stress this app is handling 5 get requests per...
6
by: stoogots2 | last post by:
am using Visual Studio 2003, .Net Framework 1.1, C#. I get a SystemNullReferenceException when trying to do a hashtable.add(string,string) from a login page, and I do not understand why because all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.