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


Why is the following code working flawlessly in Delphi 10.1 Berlin, while '' 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;;;
  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 = (

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

stored procedure test:
select from patient;

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

    Read about TFDManager and pooled modes

    The reply is currently minimized Show
  • Accepted Answer

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

    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.........