Reconnecting the MySql server reposts the last command

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
starhu
Posts: 34
Joined: Thu 13 Aug 2009 12:13

Reconnecting the MySql server reposts the last command

Post by starhu » Mon 24 Apr 2017 10:03

Hello,

The scenario is this:
-my program uses MyDac to connect MySql server
-sometimes (1-3 times a day) the connection is lost
-the program reconnects automatically (at onConnectionLost)
-at this moment the last executed command is repeated on the server.

Because almost all commands are Insert-s this provides a great problem e.g. an invoice row is duplicated.

How can I prevent this?

Thank you.

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

Re: Reconnecting the MySql server reposts the last command

Post by ViktorV » Mon 24 Apr 2017 13:47

To solve the issue, you can set the RetryMode variable to rmReconnect, but not to rmReconnectExecute.

starhu
Posts: 34
Joined: Thu 13 Aug 2009 12:13

Re: Reconnecting the MySql server reposts the last command

Post by starhu » Mon 24 Apr 2017 17:38

Thank you very much!

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

Re: Reconnecting the MySql server reposts the last command

Post by ViktorV » Wed 26 Apr 2017 11:33

Thank you for your interest to our product.
Thank you for the feedback and interest to our product.

Post Reply