Page 1 of 1

Disable throwing exception "Duplicate entry key" ??

Posted: Sun 25 Apr 2010 14:24
by maciejmt
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

Posted: Mon 26 Apr 2010 10:05
by Dimon
Try to use the following code:

Code: Select all

try
  MyQuery.Execute;
except
end;

Posted: Mon 26 Apr 2010 14:40
by maciejmt
Yes, I have the same code, but frame with error will appaear (duplicate ....).
I would like that error don't appear.

Posted: Tue 27 Apr 2010 09:42
by Dimon
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.