Need to restart WWW services?

  • Thread starter Thread starter LL
  • Start date Start date
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.
 
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.
 
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.
 
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.
 
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
 
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
 
Back
Top