Unidac - Batch - Execption
Posted: Tue 21 Sep 2021 12:22
Hi,
I use Unidac with postgres and batch transcation all work fine i've a problem with code below :
if NbParam = MAX_BATCH then
begin
try
InsertQuery.Execute(MAX_BATCH);
except on E: Exception do
WriteLog(Format('Doublon dans la table P_MESURES_STEP (%s)',[E.Message]));
end;
NbParam := 0;
end;
All work fine but after the exception (Duplicate Key) all next transcations don't work with message :
"the transaction is canceled, the commands are ignored until the end of the transaction block"
in French "la transaction est annulée, les commandes sont ignorées jusqu'à la fin du bloc de la transaction"
I think i need to intialize something after the exception is catch.
Regards
ANTOCI Alain
I use Unidac with postgres and batch transcation all work fine i've a problem with code below :
if NbParam = MAX_BATCH then
begin
try
InsertQuery.Execute(MAX_BATCH);
except on E: Exception do
WriteLog(Format('Doublon dans la table P_MESURES_STEP (%s)',[E.Message]));
end;
NbParam := 0;
end;
All work fine but after the exception (Duplicate Key) all next transcations don't work with message :
"the transaction is canceled, the commands are ignored until the end of the transaction block"
in French "la transaction est annulée, les commandes sont ignorées jusqu'à la fin du bloc de la transaction"
I think i need to intialize something after the exception is catch.
Regards
ANTOCI Alain