Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 8 Jahren, 3 Monaten
Letzter Beitrag:
vor 8 Jahren, 3 Monaten
Beteiligte Autoren:
Dan M, Novica Njagojevic

ERROR 2013 - Lost Connection to MySQL server

Startbeitrag von Dan M am 16.06.2009 20:40

The summary:

How do I re-connect to the server when my connection is sleeping?

I created a connection to the server when I created my Analysis using external files.

when I run the program it works but if I do not access the data within 15 second I get the error. According to the ISP they kill sleeping connections after15 seconds but said that the DB should automatically re-connect when the next query is executed.

this makes sense to me but it is not re-connecting. The prorgam is aborted.

PC Soft Free Technical support said ...

This is a MySQL server problem. I suggest you to search for "mysql error 20123" with Google. You will find a lot of information about the error and how to get rid of it.

This is not a WinDev problem.


--------------------------------------------
I do not think this is true????

how do I re-connect to the server after my sleeping connection is killed?



More details :
---------------------------------------------------------------------------------------------------
I am developing a back office application which accesses a MYSQL database which is used for my website.I created tehe connection to the DB when I set up the Analysis.

I am constantly getting the following error :

Request Summary (10 words maximum):
Lost connection to MySQL server during query

Request Details:
Error at line 1 of Click BTN_View process.
HReadSeekFirst function called.
native MySQL access error.
Error Number = 22

Error returned by database:
Error Number = .
Error Message:
Lost connection to MySQL server during query

----------------------------------------------------------------------------------------------

I contacted PC Soft and received the following response ...

This is a MySQL server problem. I suggest you to search for "mysql error 20123" with Google. You will find a lot of information about the error and how to get rid of it.

This is not a WinDev problem.

----------------------------------------------------------------------------------------------
This is the response from my ISP ...

The server will kill off any queries or sleeping connections that last over 15 seconds. The sleeping connections being killed off is not generally an issue because it will just re-connect when needed. Are you having any actual problems with the site?

The sleeping connections that are killed off should just reconnect automatically. You should not have to manually code in the database connection string again. Are you have issues with the back office application currently?

-----------------------------------------------------------------------------------------------

This makes sense because if I am not constantly hitting the server the connection is sleeping and I loose the connection ....

How do I re-connect?

Antworten:

Make automated procedure,that fires every,for exaple 10 minutes or less,and
searches something in the database.
This should work behind the scene and your connection is preserved.



von Novica Njagojevic - am 16.06.2009 22:40
Thanks for the suggestion but as I wrote, my ISP kills sleeping connections after 15 second.


Every10 minutes would not help and I dont think I should be hitting the server every 10 seconds to maintain a connection.

According to my ISP the connection should reconnect automatically??

How do I get WinDev to automatically re-connect when the ISP is killing my connection after 15 seconds of inactivity?

von Dan M - am 17.06.2009 17:41

Problem Solved - ERROR 2013 - Lost Connection to MySQL server

Well I am not sure if this is how it is supposed to be done but as I hack away this is what I have found works ...

1. use HOpenConnection in the initialization of the project, defining the connection (MyConnection)

2. Then everywhere you query the external database (in my case I am initiating the query in buttons, (example opening a new window to display detailed data or related data), add a line of code like this:

HChangeConnection(*,MyConnection)

(note: the * means all files/tables in the analysis)

This will re-connect to the external database.

Originally if I did not query the external database for more than 15 seconds my connection was lost and the program would crash/abort. After adding this code I have let the machine sit idle for up to 10 minutes and everything works with no disconnect.

Hop this helps someone else using external DB save a few hours ...

von Dan M - am 18.06.2009 04:21
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.