Wait Page

Discussion in 'ASP .Net' started by =?Utf-8?B?UGluZWxsYXNCb3k=?=, Jan 26, 2005.

  1. I have an stored procedure which takes long time to execute. So I am trying
    to execute the procedure in another thread by using the thread start
    function. After the SP starts processing I want to take the user to a "wait"
    page and then return them after the processing is over.

    The wait page has http-refresh header which takes it back to the starting
    page. Once the starting page has reloaded in page_load procedure I would
    like to check whether the processing has finished and if not redirect back to
    the wait page.

    Problem is I do not know how to pass data back to the application main
    thread from the secondary thread. I tried using session using
    synchlock.Session, but it errors out.

    I also tried to use a callback. But since the callback procedure also
    executes in a secondary thread I am getting the same error.

    Please help
     
    =?Utf-8?B?UGluZWxsYXNCb3k=?=, Jan 26, 2005
    #1
    1. Advertising

  2. The simplest example I've seen for such a page is this:
    http://www.aspnetpro.com/NewsletterArticle/2003/08/asp200308bm_l/asp200308bm_l.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://SteveOrr.net


    "PinellasBoy" <> wrote in message
    news:...
    >I have an stored procedure which takes long time to execute. So I am trying
    > to execute the procedure in another thread by using the thread start
    > function. After the SP starts processing I want to take the user to a
    > "wait"
    > page and then return them after the processing is over.
    >
    > The wait page has http-refresh header which takes it back to the starting
    > page. Once the starting page has reloaded in page_load procedure I would
    > like to check whether the processing has finished and if not redirect back
    > to
    > the wait page.
    >
    > Problem is I do not know how to pass data back to the application main
    > thread from the secondary thread. I tried using session using
    > synchlock.Session, but it errors out.
    >
    > I also tried to use a callback. But since the callback procedure also
    > executes in a secondary thread I am getting the same error.
    >
    > Please help
    >
     
    Steve C. Orr [MVP, MCSD], Jan 26, 2005
    #2
    1. Advertising

  3. The future will hold new options:
    http://www.devx.com/dotnet/Article/26747

    You also might consider using a queue and a windows service to handle such
    background tasks. This design could improve scalability.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "PinellasBoy" <> wrote in message
    news:...
    >I have an stored procedure which takes long time to execute. So I am trying
    > to execute the procedure in another thread by using the thread start
    > function. After the SP starts processing I want to take the user to a
    > "wait"
    > page and then return them after the processing is over.
    >
    > The wait page has http-refresh header which takes it back to the starting
    > page. Once the starting page has reloaded in page_load procedure I would
    > like to check whether the processing has finished and if not redirect back
    > to
    > the wait page.
    >
    > Problem is I do not know how to pass data back to the application main
    > thread from the secondary thread. I tried using session using
    > synchlock.Session, but it errors out.
    >
    > I also tried to use a callback. But since the callback procedure also
    > executes in a secondary thread I am getting the same error.
    >
    > Please help
    >
     
    Steve C. Orr [MVP, MCSD], Jan 26, 2005
    #3
  4. Thanks Steve,

    I have seen variant of the same approach on couple of places on the web,
    one is http://www.eggheadcafe.com/articles/20050108.asp
    But this approach requires that you have two asp.net pages one starting page
    other the end page where the actual processing will take place. There is
    nothing wrong of this method, just I was trying to avoid to split the code on
    two different pages...

    "Steve C. Orr [MVP, MCSD]" wrote:

    > The simplest example I've seen for such a page is this:
    > http://www.aspnetpro.com/NewsletterArticle/2003/08/asp200308bm_l/asp200308bm_l.asp
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > http://SteveOrr.net
    >
    >
    > "PinellasBoy" <> wrote in message
    > news:...
    > >I have an stored procedure which takes long time to execute. So I am trying
    > > to execute the procedure in another thread by using the thread start
    > > function. After the SP starts processing I want to take the user to a
    > > "wait"
    > > page and then return them after the processing is over.
    > >
    > > The wait page has http-refresh header which takes it back to the starting
    > > page. Once the starting page has reloaded in page_load procedure I would
    > > like to check whether the processing has finished and if not redirect back
    > > to
    > > the wait page.
    > >
    > > Problem is I do not know how to pass data back to the application main
    > > thread from the secondary thread. I tried using session using
    > > synchlock.Session, but it errors out.
    > >
    > > I also tried to use a callback. But since the callback procedure also
    > > executes in a secondary thread I am getting the same error.
    > >
    > > Please help
    > >

    >
    >
    >
     
    =?Utf-8?B?UGluZWxsYXNCb3k=?=, Jan 26, 2005
    #4
  5. =?Utf-8?B?UGluZWxsYXNCb3k=?=

    vMike Guest

    "PinellasBoy" <> wrote in message
    news:...
    > I have an stored procedure which takes long time to execute. So I am

    trying
    > to execute the procedure in another thread by using the thread start
    > function. After the SP starts processing I want to take the user to a

    "wait"
    > page and then return them after the processing is over.
    >
    > The wait page has http-refresh header which takes it back to the starting
    > page. Once the starting page has reloaded in page_load procedure I would
    > like to check whether the processing has finished and if not redirect back

    to
    > the wait page.
    >
    > Problem is I do not know how to pass data back to the application main
    > thread from the secondary thread. I tried using session using
    > synchlock.Session, but it errors out.
    >
    > I also tried to use a callback. But since the callback procedure also
    > executes in a secondary thread I am getting the same error.
    >
    > Please help
    >

    Can you just stay on the page and make the wait portion visible (and the
    rest not visible) while the server is processing. One way to check for
    completed process is to use cache. You can put something in cache while
    processing, check for it and continue the wait page if the cache item is
    still present. Once the operation is completed, clear the cache can
    redisplay. Don't know if this helps or not.

    Mike
     
    vMike, Jan 27, 2005
    #5
    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. Stephajn Craig

    Implement a Please Wait Page

    Stephajn Craig, Jul 24, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    533
  2. joe kenney

    please wait.. page

    joe kenney, Aug 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    3,440
    S. Justin Gengo
    Aug 14, 2003
  3. Peter Strøiman
    Replies:
    2
    Views:
    676
    Peter Strøiman
    Oct 28, 2003
  4. Huey

    How to make "fork/wait" to WAIT longer?

    Huey, Mar 1, 2004, in forum: C Programming
    Replies:
    1
    Views:
    1,968
    -berlin.de
    Mar 1, 2004
  5. bhabs
    Replies:
    2
    Views:
    381
    Tad J McClellan
    Feb 13, 2008
Loading...

Share This Page