Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

Timeout on failed MySql queries if you lose connection (6 replies)

$
0
0
Finally I was able to manage my own timeout in failing HOpenConnection on MySql (Native Access) with a trick and threads.

And what if the connection to Mysql service fails during the normal working session, after a successful connection opening? Is there a way to prevent the 20 second standard waiting and having the program in idle for all this time after a query?

In practice, for giving a real sample, I estabilish the connection with a common hopenconnection running fine. Then I run a simple query just after removing the internet cable (stopping mysql service has the same effect). Now the program hangs (window not responding) for 20 seconds before getting the error message "lost connection, error 79". A HExecuteQuery in this condition is locking.
Obviously checking the connection before each query is not an option. I want to trap and manage quickly the exception.

Thank you.

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>