Tokyo: Simultaneous use of stored procedure on MariaDB database fails with "Commands out of sync". No problem on Berlin.

0

Why is the following code working flawlessly in Delphi 10.1 Berlin, while 'fdquery2.open' fails in 10.2.1 Tokyo with an error "Commands out of sync; you can't run this command now'. I need similar code in a real program eg. showing records in a dbgrid and in a separate process printing these records on a report.

Database MariaDB 10.1 (but also 10.2).

  lblInfo.Caption:= 'Started, but not finished';
  fdconnection1.Connected:= True;
  fdquery1.open;
  fdquery2.open;
  lblInfo.Caption:= 'Started and correctly finished !!';

Fdquery1 and fdquery2 both uses the same connection FDConnection1.

Both queries calls the same stored procedure.

object FDConnection1: TFDConnection
    Params.Strings = (
      'User_Name=xxxxx'
      'Password=xxxxx'
      'DriverID=MySQL')

  object FDQuery1: TFDQuery
    Connection = FDConnection1
    SQL.Strings = (
      'call db.Test')

stored procedure test:
BEGIN
select
    patient.nr from patient;
END

Note: Solutions like setting FetchOptions.Mode:= fmAll are due to performance issues not practical

Note: On different connections it works

Responses (2)
  • Accepted Answer

    Thursday, February 08 2018, 07:24 AM - #Permalink
    0

    Read about TFDManager and pooled modes

    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, February 07 2018, 11:42 PM - #Permalink
    0

    I have the same question when I migrate my project from Delphi 10 to Delphi 10.2

    The reply is currently minimized Show
Your Reply

Please login to post a reply