Results 1 to 6 of 6

Thread: Script Execution if user disconnects

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Suppose I have a ASP script which does some hefty db operations and takes a few minutes to execute. If I then make an administrative page so the appropriate people can click the link, what happens if they get bored waiting for the script to execute and go to an other page? I know there is a way to check if they're still connected and abort the script if they're not, but I'd rather have the script still run until its finished so the database gets fully updated. Will it work that way by default? I'm running NT 4.0 Server, SP6a, and IIS 4.

    Also, will scripts timeout if they take too long to execute?

    Thanks,
    Josh

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi JoshT

    as for having it continuing if the user disconnects, I don't think there's anything you can do about it. as for scripts timing out, at the top of the hefty page use Server.ScriptTimeout = some redicusely high number and then the page won't expire.

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Since there is a Response.IsClientConnected boolean you can use to end your script if they disconnect, I would think by default the script would keep executing if you don't check this, which is what I want it to do.

    Does the Server.ScriptTimeout matter if I use Server.CreateObject to call a COM DLL? According to MSDN, "The timeout will not take effect while a server component is processing."

    Code:
    <%
    Dim objMine
    Set objMine = Server.CreateObject("MyDLL.MyClass")
    objMine.DoLotsOfStuff 'takes a while
    Set objMine = Nothing
    %>
    Thanks,
    Josh

  4. #4
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    you can put in regardless, as if your dll takes to long to finish, the script times out regardless wether it ahs finished or not

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  5. #5

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Thanks, I've set it for 7200, that should be enough. I've also noticed that the script that took about 50 seconds using VBScript/ASP only takes all of 2 seconds when compiled and called by the ASP page...

    Josh

  6. #6
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    no problems. on a side note a recomendation when making web applications is that only use vbscript when it's a small system, if you doing very heavy suff as you found out, com DLL's come into their own in speed and what you can do with them. and one thing I can't emphasise enough is that if your using comm dll's over the web, is to use MTS to mange your dll's as IIS tends to fall over when dll's are hit big time.

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width