Support Article
Foreign key constraint violation error with Obj-Save
SA-10465
Summary
When the application performs a save in a child table, it throws the referential integrity error. This error is thrown only in one environment. When the same is performed in another environment, there is no error generated. Oracle database is in use.
Error Messages
Fail: ORA-02291: integrity constraint (SCHEMA.ABC_MMM_AP_FK2) violated - parent key not found
Steps to Reproduce
1. Obj-save ( parent table )
2. Obj-save ( child table)
3. Commit to observe the changes.
Root Cause
In Pega 7.1.7, a new API that results in non-deterministic order of database SQL statement execution within a transaction in introduced.
In this case, the instance that is the target of the foreign key constraint must be inserted before the instance which has the primary key constraint. Due to the non-determinism behavior mentioned above, this is not always the case (even if the "save" operations are performed in the desired order).
Resolution
This issue is resolved through the following Local-change:
Add a prconfig setting using DSS or through prconfig.xml that reverts back to the original update mode.
name
database/batchUpdates
with value as
-1
Published June 12, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.