This is one of those "gray area" php/mysql questions ...
I wrote a php class that is basically a mysql wrapper. It detects for the availability of the mysql server and for connection timeouts. If the connection fails, it will write the query (unless it was a select) to a log file to be run at a later date manually when the server becomes available again.
The problem is that, when a query locks a table, the connection doesn't fail, so the query just sits in the queue and the queue will become extremely large. I need to find a way to timeout a query, not just the connection.
To make a long question short, how can I force a timeout on a query so as to avoid losing queries that are stuck in the queue in the event of a server reboot?
I assume I can use socket connections, but I am not sure how feasible or reliable that is.
Any help is greatly appreciated.
I wrote a php class that is basically a mysql wrapper. It detects for the availability of the mysql server and for connection timeouts. If the connection fails, it will write the query (unless it was a select) to a log file to be run at a later date manually when the server becomes available again.
The problem is that, when a query locks a table, the connection doesn't fail, so the query just sits in the queue and the queue will become extremely large. I need to find a way to timeout a query, not just the connection.
To make a long question short, how can I force a timeout on a query so as to avoid losing queries that are stuck in the queue in the event of a server reboot?
I assume I can use socket connections, but I am not sure how feasible or reliable that is.
Any help is greatly appreciated.