• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

script keeps timing out.. any ideas?

New Here ,
Dec 29, 2006 Dec 29, 2006

Copy link to clipboard

Copied

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.

TOPICS
Advanced techniques

Views

278

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

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?




Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation