Page 1 of 1

Lost connection

Posted: Wed 16 Feb 2005 16:44
by GEswin
I'm experiencing a lot of Lost Connection problems. It' always raised at this point from MySqlNet.pas

Code: Select all

  if not FCompress then begin
    if Fvio.Read(buffer, offset, count)  count then
      raise EMySqlException.Create(CR_SERVER_LOST);
  end
---------------------------
Debugger Exception Notification
---------------------------
Project UcmcW.exe raised exception class EMyError with message 'Lost connection to MySQL server during query'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
It happens quite a lot just when connecting. I'm using latest mydac and mysql 4.1.8 under Linux.

Posted: Thu 17 Feb 2005 07:32
by Ikar
Most probably, some of your queries is executed more than 30 seconds. Try to increase a value of CommandTimeout property.

Also possible that by any connection no command was executed for a long time. In this case MySQL Server itself can break a connection. Try to execute MyConnection.Ping once at some time or increase a value of appropriate server variable.

For more details about different reasons of this error occurrence please see MySQL Reference manual http://dev.mysql.com/doc/mysql/en/gone-away.html

Posted: Thu 17 Feb 2005 10:12
by GEswin
It happens quite a lot just when connecting. I'm using latest mydac and mysql 4.1.8 under Linux.
All querys are extremely fast, taking the longest less than 3 seconds. This happens also often just when connecting. I checked log on mysql, when this happens it's connected (In mysql log), and after raising exception it's disconnected from mysql (in mysql log). It happens also between a bunch of sql query's.. we run a process, and between it gets disconnected. I activated logs and found nothing strange.

I'm doing all this in direct mode. Today I'll try using direct set to false.

Posted: Fri 18 Feb 2005 10:16
by Ikar
Now we carefully revise an algorithm of transferring compressed data. Probably, we could find a problem but if you send us an example, our task will be greatly simplified.

Posted: Fri 18 Feb 2005 10:51
by GEswin
If it's of any information, i work with compression set to false. I can't send an example, since there is no way to reproduce it. Sometimes it's just when you connect, other times it happens between operations, etc.

Posted: Thu 24 Feb 2005 14:16
by GEswin
I'm working since two days with Direct set to false, and using libmysql.dll v4.1.10 and server 4.1.8 on linux without any lost connection. Seems that the problem is when working directly.

Please check this, there must be some issue that needs to be fixed, and i prefer to work in direct mode.

regards

Posted: Fri 25 Feb 2005 09:56
by Ikar
We carefully revised procedures of forming and check packets and bring them in accord with the state at most close to libmysql. Within several days a new build will be available for download.

Posted: Fri 25 Feb 2005 17:33
by GEswin
I supose that build is not the one announced today.

Posted: Wed 02 Mar 2005 07:22
by Ikar
These changes were included at the build 3.50.0.17 that is available for download now.

Posted: Wed 02 Mar 2005 08:42
by GEswin
Ok, i didn't see anything related to this in the history. I've just downloaded it and i'll try today. I'll post my results.

Regards

Posted: Sun 06 Mar 2005 19:51
by Thomas Jüntgen
I tested the build 3.50.0.17 and the error is still the same.
When I try to edit a blob value is it not possible to post due to the error "lost connection"
I use MySQL version 4.1.9 with XP system and C++ Builder 6

Direct property is true, Connection Time is set to 15, but the exception appears in the first second after the post.
The problem is easy to reproduce. The image which I want to insert is a BMP 5,5MB.

Thanks for your help

Posted: Mon 07 Mar 2005 11:05
by GEswin
Hi Thomas Jüntgen
The image which I want to insert is a BMP 5,5MB.
This can be another problem, set

Code: Select all

 max_allowed_packet  = 16M 
in my.cnf , this is the only way to work with big blob's.

I'm testing and for now I didn't get any lost-connection. But still give it another few days, since it didn't occur everyday, just from time to time.

regards

Posted: Mon 07 Mar 2005 12:16
by Thomas Jüntgen
Thanks a lot J.Pieter Vos this solved my problem.

Posted: Thu 10 Mar 2005 22:21
by jop
I got the same "Lost connection" when trying to inser a file (14Mb) in a blob field.
I checked the MySQL manual and found info about max_allowed_packet. I was to small.
I did:
set global max_allowed_packet = 1GB;

set session max_allowed_packet= 1GB;

Lost connection problem gone;

Posted: Sun 13 Mar 2005 23:13
by GEswin
These changes were included at the build 3.50.0.17 that is available for download now.
Hi Ikar

Looks like the problem is solved, i've been running applications for a few days both at my computer and at customers, and it looks like the connection lost problem is solved.

Thanks