• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

Inserting records into DB thru Coldfusion Suggestion required

I am trying to insert around 2000 record into DB from coldfusion web page but facing with a  time out error.

Can anyone pls help with workaround or suggestion for this issue.
1 Solution
Set the timeout on your page...

<cfsetting requestTimeout = "60000">

new_perl_userAuthor Commented:
I am new to cold fusion so my question may be silly but..

Is 60000 secs or mins and what is the maximum time we can allow.

Glad you asked, I thought it was milliseconds, but it's actually seconds.

So a setting of 600 should be 10 minutes, 1800 is 30 minutes.

no points ... gd already answered your original question.

Just curious. What are you inserting, a CSV file? What's your db type?
Another tipp:
If you insert a lot of records into the same database table, you can improve performance a lot by using aggregative sql script:
Instead of looping over a list or query and inserting one record one after the other with seperate cfquery tags within the loop, it is much quicker to insert a bunch of records within a single transaction. Due to buffering issues at the database you should limit the number of records to e.g. 200 to 500 recs per transaction (=cfquery tag).

The correct syntax depends on your database, here is a sample for mySQL:
<cfquery name="dummy" datasource="yourdbname">
INSERT INTO tablename (fieldname1,fieldname2) VALUES 

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now