Support Article
Unique Constraint on py_sys_ruleset_index_pk
SA-20653
Summary
DynaTrace logs show unique constraint exceptions. These exceptions are not seen in the Pega 7.1.8 PegaRULES log file.
Error Messages
Return: [java.sql.SQLException: ORA-00001: unique constraint (TPO_RULES.PR_SYS_RULESET_INDEX_PK) violated at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
Steps to Reproduce
Not Applicable
Root Cause
A defect or configuration issue in the operating environment. Prior to Pega 7.1.7 the default mode for saving (deferred/immediate) instances was insert/update. In Pega 7.1.7 the default mode was changed to merge/batch. When using a JDBC driver which is not 4.0 compliant the insert/update approach that was used in earlier versions of Pega will still be used.
Resolution
Here’s the explanation for the reported behavior: The constraint errors in the dynotrace logs which do not appear in the PegaRULES logs can be ignored. They are expected behavior. Up until Pega 7.1.7 the application uses an insert/update approach of saving items to the database. Essentially the way the insert/update approach works is to first try the insert and if that throws a constraint error then to do the update. This approach is much faster than trying to determine if the row needs to be inserted or updated. The engine takes care of catching the exception so that is why there are not any errors in the PegaRules log file. Here is an article which talks about this insert/update design.
https://pdn.pega.com/support-articles/ora-00001-unique-constraint-errors-when-monitoring
In 7.1.7 PRPC introduced merge/batch as the default mode for saving (deferred/immediate) instances. If on Pega 7.1.8 and still using insert/update either using a version of the JDBC driver which is not JDBC 4.0 compliant or merge/batch functionality has been explicitly shut off. To take advantage of the merge/batch mode then update to a 4.0 compliant JDBC driver.
Published March 16, 2016 - 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.