EMySqlException "ReceiveHeader: Net packets out of order..."

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
sachse
Posts: 3
Joined: Tue 26 Aug 2008 21:37

EMySqlException "ReceiveHeader: Net packets out of order..."

Post by sachse » Sun 01 Feb 2009 01:27

"ReceiveHeader: Net packets out of order: received[1], expected[2]"

Multiple MyCommands over one MyConnection.
Only one connection can be used because there are temporary tables.

-------------- snip -------------
type SQLQueryThread=class(TThread)
private
sqlstr:ansistring;
public
constructor Create(querystr:ansistring);
procedure Execute; override;
destructor Destroy; override;
end;

var sema_threads_running,sema_threads_completed:integer;

constructor SQLQueryThread.Create(querystr:ansistring);
begin
inherited Create(false);
sqlstr:=querystr;
inc(sema_threads_running);
end;

procedure SQLQueryThread.Execute;
var dbcmd:TMyCommand;
begin
dbcmd:=TMyCommand.Create(frm_search_database);
dbcmd.CommandTimeout:=3000;
dbcmd.ParamCheck:=false;
dbcmd.Prepared:=false;
dbcmd.Connection:=frm_main.MyConnection1;
dbcmd.SQL.Add(sqlstr);
dbcmd.Execute;
dbcmd.Free;
end;

destructor SQLQueryThread.Destroy;
begin
dec(sema_threads_running);
inc(sema_threads_completed);
inherited Destroy;
end;

-------------- snip -------------
//this part uses the threads

progressbar1.Maximum:=sqlcommandlist.Count-1;
sema_threads_running:=0;
sema_threads_completed:=0;
for i:=0 to sqlcommandlist.Count-1 do
begin
//alle befehle uebertragen
SQLQueryThread.Create(sqlcommandlist.Strings[i]);
repeat
application.ProcessMessages;
sleep(1);
until(sema_threads_running<maxquerythreads);
progressbar1.Position:=sema_threads_completed;
end;
repeat
application.ProcessMessages;
sleep(1);
progressbar1.Position:=sema_threads_completed;
until(sema_threads_running=0);
-------------- snip -------------

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 02 Feb 2009 12:34

This problem was discussed on MyDAC forum. Please view the following topic:
http://devart.com/forums/viewtopic.php?t=2972

sachse
Posts: 3
Joined: Tue 26 Aug 2008 21:37

The problem is not solved

Post by sachse » Fri 06 Feb 2009 20:53

The option described in thread 2972 is set to off now.
No change.
The error is in every test.

server info:
-------------
Linux myhost 2.6.25-gentoo-r8 #2 PREEMPT Sun Nov 9 13:34:11 CET 2008 i686 AMD Athlon(tm) XP 1800+ AuthenticAMD GNU/Linux

Server version: 5.0.70-log Gentoo Linux mysql-5.0.70-r1

cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 1800+
stepping : 2
cpu MHz : 1529.535
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow ts
bogomips : 3061.91
clflush size : 32

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 09 Feb 2009 09:30

Antaeus wrote:MyDAC can work in multithreaded applications, so it is thread safe. But the restriction is that you cannot use one component for more than one thread simultaneously.

Post Reply