Alert another session, how?

  • Thread starter Thread starter Søren M. Olesen
  • Start date Start date
S

Søren M. Olesen

Hi

Is it somehow possible to alert all other sessions than the current, that
something has changed making all other sessions take appropriate action....

If yes, what should I be looking into ??

TIA

Søren
 
hmmm, why do you need this ability?

I believe you should approach the problem in a different way. Strictly
speaking, you can set a dependency on a file and update that file when new
sessions are started but that seems like a poor design because web
applications are inherently stateless.

Maybe you should say why you need that functionality...

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
 
Basically I want to tell the other sessions, that some of data/object
it/they holds are outdated, and needs to be reread from the database....

Regards,

Søren



Alvin Bruney said:
hmmm, why do you need this ability?

I believe you should approach the problem in a different way. Strictly
speaking, you can set a dependency on a file and update that file when new
sessions are started but that seems like a poor design because web
applications are inherently stateless.

Maybe you should say why you need that functionality...

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------


Søren M. Olesen said:
Hi

Is it somehow possible to alert all other sessions than the current, that
something has changed making all other sessions take appropriate
action....

If yes, what should I be looking into ??

TIA

Søren
 
One approach is to provide a static flag responsible for the validity of the
accessed data. A database trigger or a dependency placed on a file will
monitor the file for changes. If the file changes, the static flag is set
which in turn invalidates the session store. So you would access session in
this way for each page

if(session[xxx] != null && !staticFlag)
do something.

If you google around, you will find plenty of code snippets on how to add a
cached dependency.

ASP 2.0 will allow row level dependencies by the way.
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------


Søren M. Olesen said:
Basically I want to tell the other sessions, that some of data/object
it/they holds are outdated, and needs to be reread from the database....

Regards,

Søren



Alvin Bruney said:
hmmm, why do you need this ability?

I believe you should approach the problem in a different way. Strictly
speaking, you can set a dependency on a file and update that file when
new sessions are started but that seems like a poor design because web
applications are inherently stateless.

Maybe you should say why you need that functionality...

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------


Søren M. Olesen said:
Hi

Is it somehow possible to alert all other sessions than the current,
that something has changed making all other sessions take appropriate
action....

If yes, what should I be looking into ??

TIA

Søren
 
Back
Top