3 Replies Latest reply on Dec 30, 2006 6:47 AM by proxim00

    script keeps timing out.. any ideas?

    proxim00 Level 1
      Hi everyone, well Im pulling my hair out because my script just keep dieing on the server. What the script does is gets a record set, inserts 1000 records then redirects to another page that picks up where the last page ended to try and not timeout on the server. Now the odd thing is even when I turn down the amount of records to insert like to 100 or 1 even it still times out? In theory it should restart the timeout when it hits the new page, but it seems like its almost keeping the connection opened, its really strange. anyhow this is the code.

        • 1. Re: script keeps timing out.. any ideas?
          BKBK Adobe Community Professional & MVP
          I think there is some redundancy in the variables startrow, pagestop, maxrows, block and rowcount, and that the redundancy makes the logic unclear. For example, the statement StartRow = MaxRows * StartRow + 1 doesn't make sense.

          Is the code I give below of any help? In any case, I would advise you do everything on a single page, rather than redirect. You don't have to read the tag every time, do you?




          • 2. Re: script keeps timing out.. any ideas?
            Dan Bracuk Level 5
            You have your query inside a loop. It might be more efficient to put the loop inside the query. You have to actually try it and compare to be sure. The syntax is:

            insert into yourtable
            (field1, field2, etc)

            <cfloop>
            select distinct value1, value2, etc
            from somesmalltable
            <cfif you are not finished your loop>
            union
            </cfif>
            </cfloop>

            I also agree with BKBK about doing everything on one page. The extra complications of breaking it up does not seem to provide any benefits.
            • 3. Re: script keeps timing out.. any ideas?
              proxim00 Level 1
              Thanks for your help, Ill give these a shot and report back, I agree it should all be done on one page but the hosting company said I should brake it up because that could be what was causing the time out, the spreadsheet im uploading has about 65,000 records so it just kept hitting a wall.

              Thanks again.

              Mike.