MySQL Forums
Forum List  »  Connector/ODBC

ODBC Connector 5.1.6 hangs in a specific situation (recv)
Posted by: Bonny Gijzen
Date: September 24, 2010 03:34AM

Hi,


I have written a Delphi application which uses AdoQuery to talk to a database.
It first started with an Access database and later I migrated to MySQL using the ODBC connector 5.1.6

The problem I had was that the application holds the database connection open during the whole sessions (could be 5 hours), and sometimes the connection was dropped.

Now I manage to recover from this using the following:
1) Use the AUTORECONNECT flag when connecting to server
2) Set the wait_timeout to 28800 seconds after connection
3) Set the interactive_timeout to 28800 seconds after connection
4) Periodically send a simple query as some sort of keep-alive

Sometimes the connection is still dropped and I get a nice exception, which I catch and then I recreate the connection, so far so good.

Now very rarily when using a simple query my applications hangs.
The hang happens on recv() in function SQLExecDirectW() which is used by the connector.

Here is a stacktrace to show it:
77a1f85a +00e ntdll.dll NtWaitForSingleObject
76954861 +082 WS2_32.dll recv
6db6a64b +079 ODBC32.dll SQLExecDirectW
004cafa6 +056 BiljartScoreBord.exe ADODB TADOConnection.Execute
0058a8b8 +0b0 BiljartScoreBord.exe Unit2 TForm2.SendServerKeepAlive


For now I have no way to recover from this.
Is it normal that the connector could hang (for a long time) in some situation?

I am now trying to see if I can use the options READTIMEOUT and WRITETIMEOUT, but there is something confusing me:
The documentations says these options exist but only for server 5.1.12, but I would think this is an option for the client side (connector) so how is that related to the server??

Also it seems my provider is using MySql version 5.0.91 :(

Could this be something I am doing wrong?
(As I've said this happens only very rarily but it has happened a couple of times already. Also for now it happened only on Win 7 machines.)
Could this be a bug?

Does anyone have some insight on what to do now?
I am really stuck here and the application isn't useable if it will hang at some point it time.


Many thanks in advance for your answers and insights,

Bonny



Edited 1 time(s). Last edit at 09/24/2010 03:58AM by Bonny Gijzen.

Options: ReplyQuote


Subject
Written By
Posted
ODBC Connector 5.1.6 hangs in a specific situation (recv)
September 24, 2010 03:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.