03-26-2018 01:35 AM
In our GMSC 15.3 Application we have workflow save actions, which beside saving a new feature are also entering information into a connection table. Also there are workflow actions espectially designed to save connections between features in connection tables.
We have triggers on these connection tables which should prevent that the same connection can be entered.
An example of one of the triggeres is below.
If the user is clicking with a doubble click, or as the application interprets it, two fast click after each other. The trigger is not catching it and we have twice the same connection information inside the connection table.
Trigger code: (explenation 'Retras' is a status flag, if set to 0 it means the status is activ, 1 is status deleted)
CREATE OR REPLACE TRIGGER D_IGS_CONTAINMENT_CHECK_UNIQUE
BEFORE INSERT OR UPDATE ON D_IGS_CONTAINMENT
FOR EACH ROW
IF (INSERTING AND :NEW.RETRAS = 0) OR
(UPDATING AND :NEW.RETRAS = 0 AND LD.RETRAS = 1) THEN
FROM D_IGS_CONTAINMENT IGS
WHERE IGS.XDM_FNO1 = :NEW.XDM_FNO1
AND IGS.XDM_FID1 = :NEW.XDM_FID1
AND IGS.XDM_FNO2 = :NEW.XDM_FNO2
AND IGS.XDM_FID2 = :NEW.XDM_FID2
AND IGS.RETRAS = :NEW.RETRAS;
IF UNIQUE_KEY > 0 THEN
:NEW.RETRAS := 1;
RAISE_APPLICATION_ERROR(-20000, 'LOGIC KEY ALREADY EXIST');