threading question

Discussion in 'ASP .Net' started by =?Utf-8?B?T2xlZw==?=, Apr 26, 2006.

  1. 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?
    =?Utf-8?B?T2xlZw==?=, Apr 26, 2006
    #1
    1. Advertising

  2. 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

    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "Oleg" wrote:

    > 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?
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Apr 26, 2006
    #2
    1. Advertising

  3. 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

    "Peter Bromberg [C# MVP]" wrote:

    > 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
    >
    > --
    > Co-founder, Eggheadcafe.com developer portal:
    > http://www.eggheadcafe.com
    > UnBlog:
    > http://petesbloggerama.blogspot.com
    >
    >
    >
    >
    > "Oleg" wrote:
    >
    > > 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?
    =?Utf-8?B?T2xlZw==?=, Apr 26, 2006
    #3
  4. 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.

    "Oleg" wrote:

    > 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
    >
    > "Peter Bromberg [C# MVP]" wrote:
    >
    > > 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
    > >
    > > --
    > > Co-founder, Eggheadcafe.com developer portal:
    > > http://www.eggheadcafe.com
    > > UnBlog:
    > > http://petesbloggerama.blogspot.com
    > >
    > >
    > >
    > >
    > > "Oleg" wrote:
    > >
    > > > 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?
    =?Utf-8?B?T2xlZw==?=, Apr 26, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alina
    Replies:
    0
    Views:
    1,669
    Alina
    Jul 16, 2003
  2. John

    Threading question

    John, Sep 28, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    627
    =?Utf-8?B?RGF2ZSBCYWNoZXI=?=
    Oct 7, 2004
  3. Replies:
    9
    Views:
    1,011
    Mark Space
    Dec 29, 2007
  4. Steven Woody
    Replies:
    0
    Views:
    394
    Steven Woody
    Jan 9, 2009
  5. Steven Woody
    Replies:
    0
    Views:
    434
    Steven Woody
    Jan 9, 2009
Loading...

Share This Page