Script taking longer than expected to complete: Consequences?

Discussion in 'ASP General' started by Colin Steadman, Oct 13, 2004.

  1. I've setup a very simple page which allows a group of users to start a
    procedure in Oracle from an ASP page (relevant code copied below). I
    was led to believe that the processing job was fairly quick and would
    only take a minute to complete.

    However to my disappointment, having only built and deployed the page
    a few days ago, I've already had a call from one of the users who
    tells me that its just timed out on them (timeout currently occurs
    after 90 seconds). I've made a quick mod to the page and used
    Server.ScriptTimeout 600 to give the script plenty of time to
    complete.

    However I'm now concerned about what would happen if the user
    interrupted processing mid-way through by accidently closing the
    browser window or something. What would happen on the database in
    this situation?

    To get around the problem I'm thinking about putting a transaction
    around the execution part of the code. But would this work if the all
    the SQL is doing is starting an Oracle procedure? I've only ever used
    it with straight updates before!

    TIA,

    Colin


    On Error Resume Next

    Dim cn
    Dim sql
    Dim arSQL()

    Redim arSQL(3)

    arSQL(0) = "begin"
    arSQL(1) = " db2acs_inbound_api.LOAD_MANUAL_INVOICES;"
    arSQL(2) = " commit;"
    arSQL(3) = "end;"

    Server.ScriptTimeout 600

    Set cn = Server.CreateObject("ADODB.Connection")
    cn.open Session("PROVIDER")
    cn.execute Join(arSQL,"")
    Colin Steadman, Oct 13, 2004
    #1
    1. Advertising

  2. If the user closes the browser window, the script will continue to run on
    the server. Once the request is made to the server, it starts doing what it
    has to do and runs until it's finished (or errors out, times out, whatever).
    Asuming that you cannot do anything about the duration of the database
    operations, perhaps you'll be interested in some of the ideas here.
    http://www.aspfaq.com/show.asp?id=2194

    Ray at work

    "Colin Steadman" <> wrote in message
    news:...
    > I've setup a very simple page which allows a group of users to start a
    > procedure in Oracle from an ASP page (relevant code copied below). I
    > was led to believe that the processing job was fairly quick and would
    > only take a minute to complete.
    >
    > However to my disappointment, having only built and deployed the page
    > a few days ago, I've already had a call from one of the users who
    > tells me that its just timed out on them (timeout currently occurs
    > after 90 seconds). I've made a quick mod to the page and used
    > Server.ScriptTimeout 600 to give the script plenty of time to
    > complete.
    >
    > However I'm now concerned about what would happen if the user
    > interrupted processing mid-way through by accidently closing the
    > browser window or something. What would happen on the database in
    > this situation?
    >
    > To get around the problem I'm thinking about putting a transaction
    > around the execution part of the code. But would this work if the all
    > the SQL is doing is starting an Oracle procedure? I've only ever used
    > it with straight updates before!
    >
    > TIA,
    >
    > Colin
    >
    >
    > On Error Resume Next
    >
    > Dim cn
    > Dim sql
    > Dim arSQL()
    >
    > Redim arSQL(3)
    >
    > arSQL(0) = "begin"
    > arSQL(1) = " db2acs_inbound_api.LOAD_MANUAL_INVOICES;"
    > arSQL(2) = " commit;"
    > arSQL(3) = "end;"
    >
    > Server.ScriptTimeout 600
    >
    > Set cn = Server.CreateObject("ADODB.Connection")
    > cn.open Session("PROVIDER")
    > cn.execute Join(arSQL,"")
    Ray Costanzo [MVP], Oct 13, 2004
    #2
    1. Advertising

  3. "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<#>...
    > If the user closes the browser window, the script will continue to run on
    > the server. Once the request is made to the server, it starts doing what it
    > has to do and runs until it's finished (or errors out, times out, whatever).
    > Asuming that you cannot do anything about the duration of the database
    > operations, perhaps you'll be interested in some of the ideas here.
    > http://www.aspfaq.com/show.asp?id=2194
    >
    > Ray at work
    >



    Much appreciated.

    Thanks Ray.

    Colin
    Colin Steadman, Oct 14, 2004
    #3
    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. Replies:
    1
    Views:
    559
    Gabriel Genellina
    Dec 26, 2008
  2. anshu
    Replies:
    2
    Views:
    162
    anshu
    Sep 21, 2004
  3. Jim Cain
    Replies:
    1
    Views:
    205
    Yukihiro Matsumoto
    Jul 18, 2003
  4. the_one
    Replies:
    1
    Views:
    382
    the_one
    Mar 5, 2012
  5. jgabios
    Replies:
    5
    Views:
    135
    Jeremy J Starcher
    Apr 22, 2009
Loading...

Share This Page