2

I am using ColdFusion 9.1.2

We are using a CFC to save some data via a query. After the query runs, there is a CFEXECUTE. Once that completes, which can take 30 seconds, I want to query the database that the CFEXECUTE wrote something to and return a variable. If anything gets out of order, nothing will be correct.

My question is whether CFEXECUTE fires and the ColdFusion goes onto the next thing, or does ColdFusion wait until the CFEXECUTE is complete?

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Evik James
  • 10,335
  • 18
  • 71
  • 122
  • What's CF version *9.1.2*? The only CF9 point releases I'm aware of existing are 9.0 (build 251028) and 9.0.1 (build 274733)? – Adam Cameron Oct 29 '11 at 09:10

1 Answers1

6

The timeout attribute determines this.

From the docs

Timeout

Length of time, in seconds, that ColdFusion waits for output from the spawned program.

  • 0: equivalent to nonblocking mode.
  • A very high value: equivalent to blocking mode.

If the value is 0, ColdFusion starts a process and returns immediately. ColdFusion may return control to the calling page before any program output displays. To ensure that program output displays, set the value to 2 or higher.

Adam Cameron
  • 29,677
  • 4
  • 37
  • 78
Yisroel
  • 8,164
  • 4
  • 26
  • 26
  • 1
    (May not apply in your case, but ...) It is worth noting `timeout` does not guarantee the process will *finish* in that time. Just that CF will wait that many seconds before proceeding to the next code block. – Leigh Oct 28 '11 at 19:12
  • Yes, all he can do is put in a really high value and hope its complete – Yisroel Oct 28 '11 at 19:28
  • I inherited the project and it was set at 120 seconds. It has been completing in less than 1 second though. I didn't know that timeout was mean to be used as "the maximum time to wait before moving on". Thanks! – Evik James Oct 28 '11 at 20:07