You can set a timeout limit using the timeout
attribute. This can be useful in preventing requests running far longer than they should and impacting on the whole application as a result.
The timeout
attribute sets the maximum number of seconds that each action of a query is allowed to execute before returning an error.
<cfquery datasource="Entertainment" timeout="30">
select *
from Movies
</cfquery>