[UniDac 6.0.2] Net packets out of order

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
humantool
Posts: 8
Joined: Fri 20 Mar 2015 09:42

[UniDac 6.0.2] Net packets out of order

Post by humantool » Fri 20 Mar 2015 09:55

Hi,

I'm developping with :
- Delphi Xe3,
- Windows 7 64bits,
- MySQL 5.6.20 64bits

My application is a 3 tiers application, and my software server use DataSnap technology for my software client. My client software use TClientDataset and TDataSetProvider to get Datas.
My UniConnection have a onerror event and my TDSSServer have a too.

Reguraly, when my client connect to my server and I've got this errors :

Code: Select all

10:28:51:287 - TDtmServer.MyServerConnectionError (EUniError - 2014) : Commands out of sync;  You can't run this command now
10:29:22:853 - TDtmServer.MyServerConnectionError (EUniError - 1156) :
ReceiveHeader: Net packets out of order: received[50], expected[8]
10:29:23:170 - TDtmServer.MyServerConnectionError (EUniError - 1156) :
ReceiveHeader: Net packets out of order: received[48], expected[9]
10:29:23:171 - DSServerError (EUniError) :  
ReceiveHeader: Net packets out of order: received[48], expected[9]
MySQL.ini have a connectiontimeout to 90

I've searched the forum for this issue but all answer talk about a connection for each thread : is it really linked ?

Thanks for anyone who can get me some infos or clues :wink:

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: [UniDac 6.0.2] Net packets out of order

Post by ViktorV » Fri 20 Mar 2015 10:28

The "Commands out of sync; You can't run this command now" error occurs in this case because you are trying to execute several commands through one connection. You cannot use one connection (the TMyConnection component) in several threads, so you should use a separate connection in each thread.

humantool
Posts: 8
Joined: Fri 20 Mar 2015 09:42

Re: [UniDac 6.0.2] Net packets out of order

Post by humantool » Thu 25 Jun 2015 14:02

Thanks ViktorV and sorry for my late answer, I wasn't notified by the reply....

The problem is that it's the system that allocate thread for me. I just have a main form and a datamodule for my server, and the same things for my client application.

So it would mean that each time I've got a connection, fired by an event onconnection by example, I have to create TUniConnection dynamicaly ?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: [UniDac 6.0.2] Net packets out of order

Post by ViktorV » Fri 26 Jun 2015 10:07

If the event can be called from different threads and the required TUniConnection is used in different threads, then yes - you should create a new TUniConnection instance for each thread dynamically.

humantool
Posts: 8
Joined: Fri 20 Mar 2015 09:42

Re: [UniDac 6.0.2] Net packets out of order

Post by humantool » Fri 26 Jun 2015 10:25

Ok, each client's connection create a thread with a new instance of the DataModule Server containing a TUniConnection.

We've updated to the version 6.1.3 : no more "Commands out of sync" but there is still "Net packets out of order"....
To be clear, some times we can't answer to client's requests because we've got this errors, and sometimes all works prefectly....??..and we reproduce on different environnement too......

Seems to be a ramdom problem T_T

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: [UniDac 6.0.2] Net packets out of order

Post by ViktorV » Fri 26 Jun 2015 11:21

For investigation of the issue, please compose a small sample demonstrating the problem and send it to us, including scripts for creating database objects.

Post Reply