The below exception is thrown when trying to start omsServer : === 26 Dec 2023 03:00:00,011 ERROR [] [] [Member1] [com.tibco.aff.oms.router.RouterDataRecoveryManager] [invoke] - Unable to persist router info for the order: 15472367 org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [insert into OMS_ROUTER_TBL (orchestrator, msgId, nodeid, orderId) values (?, ?, ?, ?)]; constraint [FOMOMS_OVEODM.FK_OMSRTRTBL_ORDR]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch .... .... Caused by: java.sql.BatchUpdateException: ORA-02291: integrity constraint (FOM123_TSTOPN.FK_OMSRTRTBL_ORDR) violated - parent key not found ===
Issue/Introduction
This KB article is about failure of OmsServer to start because of foreign key constraint violation error (ORA-02291: integrity constraint) related to OMS_ROUTER_TBL table.
Environment
ALL
Resolution
This issue occurs when data integrity is not maintained in ORDERS table (most probably due to human error). Above traces are logged when OmsServer tries to persist an order (`15472367` in above logs) related entry in the OMS_ROUTER_TBL table, but it could not, as there was no corresponding entry for the order (`15472367`) in the ORDERS table.
To solve this issue: 1/ Check the property "com.tibco.af.oms.router.recoveryFileFolderPath" (in ConfigValues_OMS.xml or configurator-ui). 2/ Navigate to the directory configured in above property. Please note that default location is set to "$AF_HOME/roles/routerRecoveryFileFolder" directory. 3/ Delete file(s) present at this location. 4/ Start omsServer instance.