473,399 Members | 4,177 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,399 software developers and data experts.

How does a static interfere between sessions

Hi

My question is if and how a static variable remains the same state if more than one session of my web site is running. Is the content of my static different at all sessions
or not.
For sample session 1 - Static int = 10
session 2 - Static int = 8
If a third session is running does the static interfere with the other sessions, or not.
I know maybe my quesxtion is a little bit silly, but i have problems in that kind and
ne not sure why.

Thanks a lot for answers
Bye
Nov 18 '05 #1
2 1126
"Harald" <Ha****@discussions.microsoft.com> wrote in message
news:08**********************************@microsof t.com...
Hi

My question is if and how a static variable remains the same state if more than one session of my web site is running. Is the content of my static
different at all sessions or not.
For sample session 1 - Static int = 10
session 2 - Static int = 8
If a third session is running does the static interfere with the other sessions, or not. I know maybe my quesxtion is a little bit silly, but i have problems in that kind and ne not sure why.


Statics have nothing to do with sessions.

You should almost certainly not be using statics at all.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
Hi,

A static member has application scope, meaning that all the sessions use
the same static member , you should be carefull when using it because of
threading issues, take a look at Skeet's singleton document as an example of
static member problems and how to solve them.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Harald" <Ha****@discussions.microsoft.com> wrote in message
news:08**********************************@microsof t.com...
Hi

My question is if and how a static variable remains the same state if more than one session of my web site is running. Is the content of my static
different at all sessions or not.
For sample session 1 - Static int = 10
session 2 - Static int = 8
If a third session is running does the static interfere with the other sessions, or not. I know maybe my quesxtion is a little bit silly, but i have problems in that kind and ne not sure why.

Thanks a lot for answers
Bye

Nov 18 '05 #3

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

Similar topics

2
by: Earl Teigrob | last post by:
I am using C# to program ASP.NET. I am using class of static fields to hold all variables that are common to the application, and I am sure that this is fine. However, I was also using some static...
1
by: Chris Bardon | last post by:
I'm working on a class library in .net, and am having a problem that I can only describe as a memory leak (which garbage collection was supposed to eliminate). My class library contains a single...
1
by: Homa | last post by:
Hi, It just come to my mine about conncurreny and static functions. This would not be a problem in window application because each thread has it own stack (and heap? forgot...). I'm using some...
6
by: Marek | last post by:
Hi, I am analyzing Duwamish7 source code boundled with Visual Studio .NET 2003. Could anoybody explain why the Monitor.Enter and Monitor.Exit block is used inside a static constructor? The code...
5
by: Tom Pearson | last post by:
What is the scope of static variable when programming in ASP.NET? For example I have a control class that uses static callbacks so that another window can pass a list of items to it. The control...
4
by: Michael | last post by:
Hi, I have a class with static fields. The values of those fields appear to stick between Web requests. That behaviour is a bit of a surprise to me, as I would expect the object to be completely...
4
by: =?iso-8859-1?B?Sm9oYW4gU2r2c3Ry9m0=?= | last post by:
It seems that many people experience problems with mix-ups and non-intentional sharing of sessions in ASP.NET. This is often tracked down to the use of static variables for user data, which are...
113
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
1
by: mark4asp | last post by:
I have a class containing a generic list, List<Tof static data. Immediately after this data has been bound to a control how will that affect the List<Tdata? Does the databound control interfere...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.