Re: Thread not working



I think you have problem somewhere else. Whatever you are doing with threads looks correct. You might post the whole code for your Page object.
 
Here are the facts that might help you figure out where problem is.
 
Session is locked during ASP.NET called. So only one request for one session can come in. Second request (with same SessionID) will be queued.
 
The page must run through the whole lifecycle in order for Session object to be unlocked for next request.
 
Response.Redirect( url ) or Response.Redirect( url, true ) will terminate page thus ending it's lifecycle.
Response.Redirect( url, false) will not end the lifecycle you can still be blocking the session.
 
------------------------------------------------------------------------------------------
 
I would replace redirect with Response.Write("AAA") and then see if the IE logo in right top corner is spinning.
If it is that means the page  is hanging somewhere.
 
 
Hope that helps./
 
George.
 
 
ProcessorContainer pc = new ProcessorContainer(parameters);
Thread thread = new Thread(new ThreadStart(pc.ProcessUpload));
thread.Start();

simple enough
: )

but if i were to have a problem, then the thread won't even start.

remind you, that the big processing part is shoving the file into the access
db, so the one line causing the wait is the ExecuteNonQuery() of the
OleDbCommand.

"George" wrote:

> How do you start the thread?
> Should not be a problem if you are using Thread class.
>
>
> George
>
>   "Jason Chu" <JasonChu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:6FA4DE02-436E-4C10-99A2-B0AE0F758DB5@xxxxxxxxxxxxx...
>   I have a webpage which uploads a big file onto access db.
>   if the file is say around 30 megs, it'll take around a minute for it to get
>   put into the access db.
>   I didn't want the user to wait for it, so I decided to put it on a thread.
>   The thread works, but not the way it should.
>   One of my page will start the thread, and then forward the user to another
>   page.
>   The thread will start, and browser will get forwarded to the next page, BUT
>   as soon as I click anything in that second page, the response will be stuck
>   waiting until the thread processing the upload is done.  Now that isn't very
>   much threaded now is it?...
>   Why is that happening? is putting stuff on the access db a process that has
>   to be done alone and can't be threaded?
>   Thx


Relevant Pages

  • Page lifecycle, specific events question.
    ... I have a page that inherits from a base page that is currently ... My understanding is that Session should always be available, ... also understand that it can't be available until after the cookies are ... So is 1) the above sequence for page lifecycle correct and 2) what is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Holding session in HTTPWebRequest
    ... The Session ID will be in a non-persistent cookie passed back to the ... The next page always gives response ... So I assume somehow session or some other state persistence drops in ... between first and second request. ...
    (microsoft.public.dotnet.general)
  • Re: Session Start / Application_BeginRequest Issues
    ... where can I find a complete listing of all of the events that occur during the lifecycle of a web application including Application_PreRequestHandlerExecute ... "Craig Deelsnyder" wrote: ... >> request is a new session, and captures a querystring value if the user ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session Variables - HELP !!
    ... and clean up your session management too. ... define exactly what the user's session needs to look like for the ... 'This shared property manages the class's lifecycle for you ... > A process will then retrieve that dataset and add a row and store the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: keeping http session between requests
    ... but it does not work - session is not not forwarded to second request, ... Cocoa programming in Perl: http://camelbones.sourceforge.net ...
    (comp.lang.perl.misc)