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

cfthread

Explorer ,
Apr 10, 2008 Apr 10, 2008
Can (or should) I put cfthread tags around queries?
TOPICS
Advanced techniques
722
Translate
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

correct answers 1 Correct answer

LEGEND , Apr 14, 2008 Apr 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.
Translate
Community Expert ,
Apr 13, 2008 Apr 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.

Translate
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
Explorer ,
Apr 13, 2008 Apr 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?
Translate
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 ,
Apr 14, 2008 Apr 14, 2008
LATEST
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.
Translate
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 ,
Apr 14, 2008 Apr 14, 2008
markireland wrote:
> 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.

You need to explore this requirement more to find out its ramifications
and details.

Who's form is disabled? The one user who submitted a request that
triggered the 40 minute query or all users accessing a given form during
the run time of the query? What actually triggers the query run? A
user's action or some scheduled task or what? Are users to be notified
somehow that the query is done and the data is ready to be accessed or
do they just get access to the form when requested as long as the query
is not running?

That short sentence is a lot of complex ramifications to it.
Translate
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 ,
Apr 14, 2008 Apr 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.

Translate
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