Disable throwing exception "Duplicate entry key" ??

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
maciejmt
Posts: 27
Joined: Sun 25 Apr 2010 14:14

Disable throwing exception "Duplicate entry key" ??

Post by maciejmt » Sun 25 Apr 2010 14:24

Hi.
I built two application (client & server) based on TServerSocket and TClientSocket.

Client send query(SendText(string)) to server and server it execute.
Each query is confirmed.
It may happen that the confirmation gets lost, server execute the query, but client send query again because dont get confirmation.
As a result, server throw execption "duplicate ...."

Is possible to check query before execute, or disable throwing exception ?

I use: TMyConnection and TMyQuery

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

Post by Dimon » Mon 26 Apr 2010 10:05

Try to use the following code:

Code: Select all

try
  MyQuery.Execute;
except
end;

maciejmt
Posts: 27
Joined: Sun 25 Apr 2010 14:14

Post by maciejmt » Mon 26 Apr 2010 14:40

Yes, I have the same code, but frame with error will appaear (duplicate ....).
I would like that error don't appear.

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

Post by Dimon » Tue 27 Apr 2010 09:42

When you use the try...except block, exception can not appear.

I can not reproduce the problem. Please, try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.

Post Reply