Page 1 of 1

Mysql Query Timeout

Posted: Fri Jun 10, 2005 2:42 pm
by tweenerz
Is it possible to attach a timeout onto a mysql query - not just a connection. What is happening is that after a successful connection, a query may lock a table indefinately for whatever reason. Then the mysql queue starts to build up real fast. Is there a way to send a query, but force a timeout so that the browser doesn't hang and the query doesn't just sit in the queue until the server is rebooted, at which point all the queries in the queue are lost.

I am basically trying to build a fool-proof way of saving vital queries from being lost. Once the timeout is detected, I would probably log the query to a text fiel or something.

Thanks for any help. :P

Re: Mysql Query Timeout

Posted: Sat Jun 11, 2005 6:37 am
by onion2k
tweenerz wrote:I am basically trying to build a fool-proof way of saving vital queries from being lost. Once the timeout is detected, I would probably log the query to a text fiel or something.
Using transactions would be a better option, but it rather depends on the version of MySQL you're using.