UNVERIFIED SOLUTION i

EngageOne 3.1.1.1 and 3.1.2 - error when attempting 'Delete All Previous Versions'

Product Feature: Administration

Operating System: AIX
 

Issue

When clicking Delete All Previous Versions it immediately comes up with an error 'Technical difficulty, please contact your administrator.' When looking at the database log we can see the following error:

Caused by: com.g1.ocm.api.DocumentException: java.sql.SQLException: ORA-02292: integrity constraint (EOSERVERNAME.FK_OCM_DEVICE_RES_DOC_RES) violated - child record found at com.g1.ocm.ws.TemplateSvcImpl.deleteAllPreviousVersions(TemplateSvcImpl.java:393) ... 42 moreCaused by: java.sql.SQLException: ORA-02292: integrity constraint (EOSERVERNAME.FK_OCM_DEVICE_RES_DOC_RES) violated - child record found
 

Cause

Known issue with 3.1.1.1 and 3.1.2 of EngageOne, and will be resolved in V4

Resolution

UPDATED: April 3, 2017
The following SQL resolved the issue (from EOS-1162), but you must backup your DB and support should be consulted prior to doing this:

DECLARE
v_exists NUMBER(10) := 0;
BEGIN
select count(*) into v_exists from all_constraints where constraint_name = 'FK_OCM_DEVICE_RES_DOC_RES' and owner = SYS_CONTEXT('USERENV','CURRENT_SCHEMA');

if (v_exists <> 0) then
execute immediate 'ALTER TABLE OCM_DEVICE_RESOURCE
DROP CONSTRAINT FK_OCM_DEVICE_RES_DOC_RES';
end if;

execute immediate 'ALTER TABLE OCM_DEVICE_RESOURCE
ADD CONSTRAINT FK_OCM_DEVICE_RES_DOC_RES FOREIGN KEY
(
HIPFILE_ID
)
REFERENCES DOC_RESOURCES
(
DOC_Resource_ID
)
ON DELETE CASCADE
ENABLE';
end;