threading question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Let's say I have a thread, long running, span by page1.
I'm redirected to page2.
In order to stop process in the thread i need to send command.close().
Q: can i store a reference to a command object in the Session variable and
how?
 
Oleg,
Generally speaking you are going to have a lot of difficulty with the
concept of spawning a background thread from an aspx page because of the
built-in transient nature of the Page class.

Consider having a class in Application state whose method does this.
Peter
 
It would have to be in Session..
Are you saying to run it asynchronosly from the page? I'm not sure how.

I already have a thread creating a Dataset and eventually storing result in
Session. Now I need to cancel db call, like in Command.Cancel().

Oleg
 
By the way, the reason for reference was because myobject.command may change
a value while thread is working. So I wanted to keep a reference to it like
you would send a reference inside a function call.
 
Back
Top