ColdFusion · Database exception

CFQuery Timeout With MySQL 5 Driver

What does CFQuery Timeout With MySQL 5 Driver mean in ColdFusion?

When a cfquery against MySQL exceeds its timeout attribute, ColdFusion opens a separate out-of-pool connection and issues a MySQL KILL QUERY against the running statement rather than aborting the page request immediately. For a multi-statement query, KILL QUERY only stops the currently executing statement — remaining statements in the same query still run to completion before ColdFusion actually throws the timeout error, so the page can hang well past the configured timeout value.

CFQuery Timeout With MySQL 5 DriverAdobe ColdFusion

Condition

When a cfquery against MySQL exceeds its timeout attribute, ColdFusion opens a separate out-of-pool connection and issues a MySQL KILL QUERY against the running statement rather than aborting the page request immediately. For a multi-statement query, KILL QUERY only stops the currently executing statement — remaining statements in the same query still run to completion before ColdFusion actually throws the timeout error, so the page can hang well past the configured timeout value.

Fix

Keep timed queries to a single statement where the timeout genuinely needs to be reliable, and don't treat the timeout attribute as a hard wall-clock cutoff for multi-statement MySQL queries — split them into separate cfquery calls instead.

Pending source verification. Not yet checked against official documentation.

Related database exception