The timeout program
The timeout program demonstrates how to set up a timeout interval.
This program uses the sqlbreakcallback() function
to perform the following actions:
- To specify a timeout interval of 200 milliseconds for execution of an SQL request
- To register the on_timeout() callback function to be called when an SQL request begins and ends as well as when the timeout interval elapses
If execution of an SQL request exceeds the timeout interval, the callback function uses the sqldone() function to ensure that the database server is still busy, prompts the user for confirmation of the interrupt, and then uses the sqlbreak() function to send an interrupt request to the database server.