Skip to main content
markireland
Known Participant
April 11, 2008
解決済み

cfthread

  • April 11, 2008
  • 返信数 2.
  • 773 ビュー
Can (or should) I put cfthread tags around queries?
このトピックへの返信は締め切られました。
解決に役立った回答 Dan_Bracuk
40 minutes is huge for a query. What you want to do is:

1. Ask yourself why it takes so long.
2. Figure out a way to run it without making the user wait.

cfthread is not your answer.

返信数 2

BKBK
Community Expert
Community Expert
April 14, 2008
The app will disable forms while the query is running and re-enable when its finished.

Is that easy to achieve, or even possible? If you do it with cfthread or with cfexecute Coldfusion will spawn a thread away from the current page. I don't see how you will disable a form on the page till the spawned process is complete.

BKBK
Community Expert
Community Expert
April 13, 2008
You can. You shouldn't create extra threads unless you need to. Threads consume resources, are difficult to manage in a program and may cause deadlock. Remember that a query represents a potential complication, as it makes a connection to an external server, the database server.

markireland
markireland作成者
Known Participant
April 13, 2008
I have been asked to include a query that will take 40 minutes.
The app will disable forms while the query is running and re-enable when its finished.

Should I cfexecute a script instead?
Dan_Bracuk解決!
Inspiring
April 14, 2008
40 minutes is huge for a query. What you want to do is:

1. Ask yourself why it takes so long.
2. Figure out a way to run it without making the user wait.

cfthread is not your answer.