Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
13
Erster Beitrag:
vor 8 Monaten
Letzter Beitrag:
vor 7 Monaten, 1 Woche
Beteiligte Autoren:
Sarah Tanti, ccc2, kingdr, DannHCS, Peter Holemans, Ccc2

MySQL Server has gone away

Startbeitrag von Sarah Tanti am 22.02.2017 10:41

Hi all,

I'm getting the below error message whenever I try to use Open() or Openchild() in the code.
I have set the wait_timeout on the MySQL server that I'm using to 31536000 which should be sufficient.
This only happens after the system is idle for more than 6 minutes.

Has anyone experienced this before?

Any help appreciated

Thanks
Sarah



Error at line 15 of Global Procedure GPU_nGetParentGroupID process ('WDGPU' component).
HReadSeekFirst function called.
native MySQL access error.
Error Number = 22

The following error was returned by the database:
Error number = .
Error message:
MySQL server has gone away

----- Technical Information -----

Project : Net
Component : WDGPU

WL call:
Process of 'Global Procedure GPU_nGetParentGroupID' (SET_GPU.GPU_nGetParentGroupID), line 15, thread 0
'HReadSeekFirst' function, syntax 0

What happened?
native MySQL access error.
Error Number = 22

The following error was returned by the database:
Error number = .
Error message:
MySQL server has gone away

Error code: 73001
Level: fatal error
WD55 error code: 3001

Dump of the error of 'wd210hf.dll' module (21.0.124.0).
Identifier of detailed information (.err): 72801
Debugging information:
IEWDMSQL=100.23
Module=
Version=
Client layer: C:\My Projects 19\Net\Exe\Net\libmysql.dll
Provider: WinDevMySQL
User: blyeUsers
Data source: 212.56.158.249
Database: blyea
Unicode supported: 1
Page code of WL: 1252
Page code of the connection: 1252
Query run on the server, database, user:
SELECT `IDGroup`,`Name`,`ParentGroupID` FROM `GPU_Group` WHERE `IDGroup`=12 ORDER BY 1 LIMIT 100
Fonction (7,12)
Additional Information:
EIT_BASECODE :
EIT_INFOCLIENT :
EIT_INFOSERVEUR :
EIT_NATIVECODE :
EIT_LOGICALTABLENAME :
EIT_PILEWL :
Global Procedure GPU_nGetParentGroupID (SET_GPU.GPU_nGetParentGroupID), line 15
Global Procedure GPU_nCalculateDefaultStatusRecursiveGroup (SET_GPU.GPU_nCalculateDefaultStatusRecursiveGroup), line 30
Global Procedure GPU_nCalculateDefaultStatusUser (SET_GPU.GPU_nCalculateDefaultStatusUser), line 34
Global Procedure GPU_nGetDefaultStatus (SET_GPU.GPU_nGetDefaultStatus), line 24
Global Procedure GPU_nGetElementStatus (SET_GPU.GPU_nGetElementStatus), line 22
Global Procedure GPU_nGetStatusUserElement (SET_GPU.GPU_nGetStatusUserElement), line 19
EIT_COMPOSANT :
WDGPU
EIT_DATEHEURE : 22/02/2017 11:36:04
EIT_TYPE_WDFILE :
EIT_IDCODE :

Antworten:

Yes,

I periodically call a query: SELECT NOW()
Every 5 minutes.
It prevents the connection from falling.

Dann

von DannHCS - am 08.03.2017 08:00
Hi Dann,

Thank you for your reply.

Do you use the SQLExec (Function) for this?
And do you place this piece of code in the Menu screen or in a global procedure?

Thanks a lot
Sarah

von Sarah Tanti - am 08.03.2017 08:28
Hi Sarah,

I open a thread in the first window.
The thread contains a "WHILE True" that calls HExecuteSQLQuery every 5 minutes.

You're welcome
Dann

von DannHCS - am 08.03.2017 09:01
Hi

I never have timeout issue in sqlServer2012 from wb/d15 to wb/d21 except I do with hfSQL (but it will reconnect in 120 sec, weird) if w/s remains idling.

It could be related to your ROUTER/wifi timeout issue, pls chk with yr infrastructure
guys to sort out as I used to have in sonicPoint in sonicWall router and once I set time out
more 6 hours and w/s works good within the timout limit.

What versions of your sqlServer and wx???

Chk also your IIS if you're running wbAppServer.

HTH

King

von kingdr - am 08.03.2017 10:35
FYI. So does mySql server in Linux with native mySql wd21, it's all good within timeout limit.

Pls chk your AV program on your w/s running Windows but there's always a problem
whenever the Windows upated automatically and worst with Win10-64 bit.

Tempting to move away Windows as client w/s.

King

von kingdr - am 08.03.2017 10:39
just to be sure, are we talking about remote connection or local network ?

von ccc2 - am 08.03.2017 16:41
Hi,

It's a remote connection.

Sarah

von Sarah Tanti - am 08.03.2017 16:44
Hi,

Just to be clear,
1. is this remote connection over internet
2. is this problem also occur in local network (LAN)

von ccc2 - am 09.03.2017 10:45
Hi

This is a remote connection over the internet.

Sarah

von Sarah Tanti - am 09.03.2017 10:48
Quote
Sarah Tanti
Hi

This is a remote connection over the internet.

Sarah


Is the problem also occured when you connect local network

von Ccc2 - am 09.03.2017 13:31
Hi Sarah,

Although moving away from WX, I'ld still like to share some best practices for you guys and girls to use.
Several options to take into account here (Specially for remote databases).
1) Command Time Out threshold
2) Compression of the data transfer or not
3) For HFCS set frame-options

Here's a code sample of mine (method that handles a db connection):

//Process Connection
//Catch Exception handling
WHEN EXCEPTION IN
//Connect to database
SWITCH :: DB_Type
//HYPERFILE SQL CLIENT/SERVER
CASE hAccessHFClientServer, hAccèsHFClientServeur, "hAccessHFClientServer", "hAccèsHFClientServeur"
//Describe the new connection
:: DB_Connection..Caption = "MyConnection"
:: DB_Connection..User = :: DB_UserName
:: DB_Connection..Password = :: DB_Password
:: DB_Connection..Server = :: DB_Server+":"+:: DB_PortNumber
:: DB_Connection..Database = :: DB_Name
:: DB_Connection..Provider = hAccessHFClientServer
:: DB_Connection..Access = hOReadWrite

<COMPILE IF ConfigurationType <> Site AND ConfigurationType <> Webservice >
//Test which type of connection is faster
DB_CnxCompressed = :: DB_Connection
DB_CnxCompressed..Caption = "TmpConnectionCompressed"
DB_CnxCompressed..Compression = True
IF HDescribeConnection(DB_CnxCompressed..Caption,DB_CnxCompressed..User,:: DB_Password,DB_CnxCompressed..Server,DB_CnxCompressed..Database,DB_CnxCompressed..Provider,DB_CnxCompressed..Access) THEN
IF :: DB_OnInternet THEN
//Set internet connection context
HCS.Timeout = INTERNET
HCS.FrameSize = hInternetFrame
END

IF HOpenConnection(DB_CnxCompressed..Caption) THEN
DB_CnxQualityCompressed = HConnectionQuality(DB_CnxCompressed)
HCloseConnection(DB_CnxCompressed)
END
END
DB_CnxUncompressed = :: DB_Connection
DB_CnxUncompressed..Caption = "TmpConnectionUncompressed"
DB_CnxUncompressed..Compression = False
IF HDescribeConnection(DB_CnxUncompressed..Caption,DB_CnxUncompressed..User,:: DB_Password,DB_CnxUncompressed..Server,DB_CnxUncompressed..Database,DB_CnxUncompressed..Provider,DB_CnxUncompressed..Access) THEN
IF :: DB_OnInternet THEN
//Set internet connection context
HCS.Timeout = INTERNET
HCS.FrameSize = hInternetFrame
END

IF HOpenConnection(DB_CnxUncompressed..Caption) THEN
DB_CnxQualityUncompressed = HConnectionQuality(DB_CnxUncompressed)
HCloseConnection(DB_CnxUncompressed)
END
END
//Now set compressed or uncommpressed mode
IF DB_CnxQualityCompressed > DB_CnxQualityUncompressed THEN
:: DB_Connection..Compression = True
END

<END>

IF HDescribeConnection(:: DB_Connection..Caption,:: DB_Connection..User,:: DB_Password,:: DB_Connection..Server,:: DB_Connection..Database,:: DB_Connection..Provider,:: DB_Connection..Access) THEN
<COMPILE IF ConfigurationType <> Site AND ConfigurationType <> Webservice >
IF :: DB_OnInternet THEN
//Set internet connection context
HCS.Timeout = INTERNET
HCS.FrameSize = hInternetFrame
END

<END>

IF HOpenConnection(:: DB_Connection..Caption) THEN
IF NOT HChangeConnection(pFileGroup,:: DB_Connection..Caption) THEN
ErrMsg:AddToList(pErrLst,soErrorMessage::EM_ERROR,"DB",StringBuild("The database connection could not be set for the filegroup '%1'. Contact your supplier if the problem persists.",pFileGroup),ErrorInfo(errMessage))
::LogError(pErrLst,ErrorInfo(errFullDetails))
RESULT False
ELSE
RESULT True
END
ELSE
ErrMsg:AddToList(pErrLst,soErrorMessage::EM_ERROR,"DB","The database connection could not be opened. Contact your supplier if the problem persists.",ErrorInfo(errMessage))
::LogError(pErrLst,ErrorInfo(errFullDetails))
RESULT False
END
ELSE
ErrMsg:AddToList(pErrLst,soErrorMessage::EM_ERROR,"DB","The database connection could not be defined. Contact your supplier if the problem persists.",ErrorInfo(errMessage))
::LogError(pErrLst,ErrorInfo(errFullDetails))
RESULT False
END
//OLEDB MS SQLSERVER
CASE hOledbSQLServer, "hOledbSQLServer"
//Describe the new connection
:: DB_Connection..Caption = "MyConnection"
:: DB_Connection..User = :: DB_UserName
:: DB_Connection..Password = :: DB_Password
:: DB_Connection..Server = :: DB_Server //+":"+:: DB_PortNumber
:: DB_Connection..Database = :: DB_Name
:: DB_Connection..Provider = hOledbSQLServer
:: DB_Connection..Access = hOReadWrite
DB_TimeOut is int = 120 //Max wait time for SQL return by the WD engine in seconds - TO DO: Implement as ini setting into framework
IF HDescribeConnection(:: DB_Connection..Caption,:: DB_UserName,:: DB_Password,:: DB_Server,:: DB_Name,hOledbSQLServer,hOReadWrite,

"WD Command Timeout ="+DB_TimeOut) THEN
IF HOpenConnection(:: DB_Connection..Caption) THEN
IF NOT HChangeConnection("*",:: DB_Connection..Caption) THEN
ErrMsg:AddToList(pErrLst,soErrorMessage::EM_ERROR,"DB",StringBuild("The database connection could not be set for the filegroup '%1'. Contact your supplier if the problem persists.",pFileGroup),ErrorInfo(errMessage))
::LogError(pErrLst,ErrorInfo(errFullDetails))
RESULT False
ELSE
RESULT True
END
ELSE
ErrMsg:AddToList(pErrLst,soErrorMessage::EM_ERROR,"DB","The database connection could not be opened. Contact your supplier if the problem persists.",ErrorInfo(errMessage))
::LogError(pErrLst,ErrorInfo(errFullDetails))
RESULT False
END
ELSE
ErrMsg:AddToList(pErrLst,soErrorMessage::EM_ERROR,"DB","The database connection could not be defined. Contact your supplier if the problem persists.",ErrorInfo(errMessage))
::LogError(pErrLst,ErrorInfo(errFullDetails))
RESULT False
END

//OTHER CASES UNSUPPORTED FOR NOW
OTHER CASE
//[### TO DO: Above you can foresee other connectivity modes in other CASE statements ###]
ErrMsg:AddToList(pErrLst,soErrorMessage::EM_ERROR,"DB",StringBuild("The requested databasetype '%1' is not supported by this application.",:: DB_Type),"Please review your databasesettings.")
RESULT False
END
DO
::LogException(pErrLst,ExceptionInfo(errFullDetails))
ExceptionEnable()
RESULT False
END


I hope this helps !

Cheers,

Peter

von Peter Holemans - am 09.03.2017 14:14
Hi all,

It seems that the issue is coming from the Groupware.

If the Groupware is located on the remote server, it closes the connection and thus whenever you need to open a window, it gives you that error.

If the Groupware is located on the local machine, or there is no Groupware at all, the connection is not lost with the HExecuteSQLQuery every 5 minutes.

Thanks
Sarah

von Sarah Tanti - am 11.03.2017 13:20
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.