Whats the best way for a thread to update session information?

  • Thread starter Thread starter Brian Cryer
  • Start date Start date
B

Brian Cryer

I'm developing a website which at one point has a hefty amount of data
processing to do. I delegate this to a separate thread and on the results
page do an auto-refresh every few seconds until the results are available.

In my thread I take a reference to the page that invoked the thread, so that
I can get access to the session object. The thread writes to the session to
indicate that it has finished. This all worked fine, until I decided to
switch from InProc to StateServer. Whilst I don't get any errors, it behaves
as though the session object my thread is referencing is different to the
one that my results page is referencing and my communications therefore
don't work any more.

So, my question is, what is the best way for a thread to get access to the
current session object?

(I'm sure it should be sooo easy but ....)

thanks in advance,

Brian.
 
Brian,

I am not sure if I understand you, however if I do.

I don't see the sence of what you are doing, you are creating probably a
bunch of overhead to tell the client that he has to watch what is mostly
done by a WaitCursor.

However your pages are stateless, which means that as soon that you do the
sent, the page is gone out of memory, with all that belongs to him except
the session information, his extra threads are left alone.

Maybe can you do what you want by creating an extra windowservice or
webservice which than can return the information because of a session.id

As I said, be aware that you are creating a bunch of overhead, where your
user has to wait for. A webserver is not a one to one operating process, it
should be able to handle an enormous amount of clients.

I hope this gives some idea's,

Cor
 
Cor Ligthert said:
Brian,

I am not sure if I understand you, however if I do.

I don't see the sence of what you are doing, you are creating probably a
bunch of overhead to tell the client that he has to watch what is mostly
done by a WaitCursor.

However your pages are stateless, which means that as soon that you do the
sent, the page is gone out of memory, with all that belongs to him except
the session information, his extra threads are left alone.

Maybe can you do what you want by creating an extra windowservice or
webservice which than can return the information because of a session.id

As I said, be aware that you are creating a bunch of overhead, where your
user has to wait for. A webserver is not a one to one operating process,
it should be able to handle an enormous amount of clients.

I hope this gives some idea's,

Cor

I don't mean to appear dense, but how does one implement a WaitCursor for a
web page? I've only seen it used on desktop applications (where session
isn't an issue anyway).

thanks,

Brian.
 
Brian,

AFAIK is in in most cases (there are exceptions) in ASPNET automatic when
the page is waiting for a postback.

Cor
 
Cor Ligthert said:
Brian,

AFAIK is in in most cases (there are exceptions) in ASPNET automatic when
the page is waiting for a postback.

Cor

Never seen it, and I don't want to risk the browser timing out.
 

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

Back
Top