Loading ...
Sorry, an error occurred while loading the content.

Re: Long process with ASP

Expand Messages
  • Josh Chamas
    ... This behavior is good generally in that you want your web page transaction to occur once started regardless of whether the user closes their browser early.
    Message 1 of 2 , Aug 7, 2003
    • 0 Attachment
      Lisenberg Julian wrote:
      >
      > But, after coding a really long process, I discovered something. When I
      > close the client page that is processing the ASP, the process keep
      > processing à it does not finish as I supposed. I have opened the DB
      > after closing the client’s page, and the information keeps growing. Why
      > is this happening? Is it good or is it bad? Do you know any way to stop
      > a process like this? Does this kind of process have something to do with
      > multi-threads?
      >

      This behavior is good generally in that you want your web page transaction
      to occur once started regardless of whether the user closes their browser
      early. Imagine writing things to a database, and having only part of those
      writes go through.

      If you have a long running script, and you want to stop it early if the
      user closes their web browser, then check $Response->IsClientConnected
      method call, and if it returns false, then call $Response->End.

      > Finally, I was able to handle this process with application variables,
      > so I could start this process, close the client page, and open it again
      > and saw were it was. Is this safe?

      I am not sure what you mean with "application variables", but if you
      meaning storing things in $Application, then yes it is safe to read/write
      to $Application variables concurrently, same is true with $Session
      data across multiple concurrent requests ... the underlying MLDBM::Sync
      storage manager handles this for you without database corruption.

      Regards,

      Josh

      ________________________________________________________________
      Josh Chamas, Founder phone:925-552-0128
      Chamas Enterprises Inc. http://www.chamas.com
      NodeWorks Link Checking http://www.nodeworks.com


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    Your message has been successfully submitted and would be delivered to recipients shortly.