Need to restart WWW services?

L

LL

Hi,

I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

I also have several Session variables. When Session_End event fire, all of
them are null, right?

Thanks.
 
K

Kevin Spencer

I use Applicaiton lever variable like this: Application["MyVal"] = xxx;
Do I need to restart the WWW service every time to reset it?

Depends. On Windows Server 2003, using IIS 6, you can simply recycle the
Application Pool in which that app runs. Otherwise, yes.
I also have several Session variables. When Session_End event fire, all of
them are null, right?

Before, during, or after? After Session_End fires, they are all moot. The
Session doesn't exist any more.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

LL said:
Hi,

I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

I also have several Session variables. When Session_End event fire, all of
them are null, right?

Thanks.
 
B

Boban Dragojlovic

I don't think that's correct.

Changes to the application object are immediately visible to everyone. That
object is threaded in such a way that all changes are "single-file"

For that reason, you don't want to alter that object too often, as it can
kill your performance


Kevin Spencer said:
I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

Depends. On Windows Server 2003, using IIS 6, you can simply recycle the
Application Pool in which that app runs. Otherwise, yes.
I also have several Session variables. When Session_End event fire, all of
them are null, right?

Before, during, or after? After Session_End fires, they are all moot. The
Session doesn't exist any more.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

LL said:
Hi,

I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

I also have several Session variables. When Session_End event fire, all of
them are null, right?

Thanks.
 
L

LL

Other way to reset the application lever variables?
I have a 4 CPU server. I found after I restart the WWW service, the
variables are still being cached.

Thanks for the help.


Kevin Spencer said:
I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

Depends. On Windows Server 2003, using IIS 6, you can simply recycle the
Application Pool in which that app runs. Otherwise, yes.
I also have several Session variables. When Session_End event fire, all of
them are null, right?

Before, during, or after? After Session_End fires, they are all moot. The
Session doesn't exist any more.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

LL said:
Hi,

I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

I also have several Session variables. When Session_End event fire, all of
them are null, right?

Thanks.
 
K

Kevin Spencer

You can manipulate Application-level variables as well as other
memory-resident data in your code, without having to restart anything. I'm
not sure what you're getting at.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

LL said:
Other way to reset the application lever variables?
I have a 4 CPU server. I found after I restart the WWW service, the
variables are still being cached.

Thanks for the help.


Kevin Spencer said:
I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

Depends. On Windows Server 2003, using IIS 6, you can simply recycle the
Application Pool in which that app runs. Otherwise, yes.
I also have several Session variables. When Session_End event fire,
all
of
them are null, right?

Before, during, or after? After Session_End fires, they are all moot. The
Session doesn't exist any more.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

LL said:
Hi,

I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

I also have several Session variables. When Session_End event fire,
all
 
K

Kevin Spencer

I don't think that's correct.
Changes to the application object are immediately visible to everyone. That
object is threaded in such a way that all changes are "single-file"

Yeah, I think I mis-read his question. Whether or not he needs to restart
his app depends on a number of factors, but if he programmatically sets an
Application-level variable, it is of course changed right away, with no need
to restart the app. On the other hand, if, for example, the
Application_OnStart Event Handler loads data from a database into the Cache,
it would need to be restarted to get the fresh data.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

Boban Dragojlovic said:
I don't think that's correct.

Changes to the application object are immediately visible to everyone. That
object is threaded in such a way that all changes are "single-file"

For that reason, you don't want to alter that object too often, as it can
kill your performance


Kevin Spencer said:
I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

Depends. On Windows Server 2003, using IIS 6, you can simply recycle the
Application Pool in which that app runs. Otherwise, yes.
I also have several Session variables. When Session_End event fire,
all
of
them are null, right?

Before, during, or after? After Session_End fires, they are all moot. The
Session doesn't exist any more.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

LL said:
Hi,

I use Applicaiton lever variable like this: Application["MyVal"] = xxx;

Do I need to restart the WWW service every time to reset it?

I also have several Session variables. When Session_End event fire,
all
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top