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