Question

Violation of PRIMARY KEY constraint 'pr4_rule_PK'

We are getting the below mentioned exception for number of rules while import. Can someone help understand why we are getting these issues.

Problem #1, SQLState 23000, Error code 2627: java.sql.BatchUpdateException: Violation of PRIMARY KEY constraint 'pr4_rule_PK'. Cannot insert duplicate key in object 'rules.pr4_rule'. The duplicate key value is (RULE-HTML-SECTION DATA-ADDRESS-POSTAL CAPTUREBUSINESSADDRESS #20181025T012903.313 GMT).

at com.pega.pegarules.data.internal.access.ExceptionInformation.createExceptionDueToDBFailure(ExceptionInformation.java:293)

at com.pega.pegarules.data.internal.access.ConnectionStatementStore.executeBatchForAllStatements(ConnectionStatementStore.java:200)

at com.pega.pegarules.data.internal.access.ThreadConnectionStoreImpl.executeOutstandingBatches(ThreadConnectionStoreImpl.java:269)

at com.pega.pegarules.data.internal.access.DatabaseImpl.attemptToProcessUpdates(DatabaseImpl.java:2676)

at com.pega.pegarules.data.internal.access.DatabaseImpl.processUpdates(DatabaseImpl.java:2322)

at com.pega.pegarules.data.internal.access.Saver.save(Saver.java:651)

at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:5108)

at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:5094)

at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:5086)

at com.pega.pegarules.deploy.internal.loaders.SaverLoader.failoverCommit(SaverLoader.java:989)

at com.pega.pegarules.deploy.internal.loaders.SaverLoader.issueCommit(SaverLoader.java:834)

at com.pega.pegarules.deploy.internal.loaders.SaverLoader.importContents(SaverLoader.java:263)

at com.pega.pegarules.deploy.internal.util.ImportImpl.performImport(ImportImpl.java:889)

at com.pega.pegarules.deploy.internal.util.ImportImpl.performImport(ImportImpl.java:762)

at com.pega.pegarules.deploy.internal.util.ImportImpl.importArchive(ImportImpl.java:670)

at com.pega.pegarules.deploy.internal.util.ImportImpl.importPegaArchive(ImportImpl.java:739)

at com.pega.pegarules.deploy.internal.archive.PegaArchiveAbstract.doImport(PegaArchiveAbstract.java:362)

at com.pegarules.generated.pxImportArchive_071017_w7IoE2VtDRzvUs1h_YGZlQ.pxImportArchive07_10_17(pxImportArchive_071017_w7IoE2VtDRzvUs1h_YGZlQ.java:143)

at com.pegarules.generated.pxImportArchive_071017_w7IoE2VtDRzvUs1h_YGZlQ.invoke(pxImportArchive_071017_w7IoE2VtDRzvUs1h_YGZlQ.java:85)

at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:133)

at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:110)

at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9000)

at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflection(LibrarySupport.java:181)

at com.pegarules.generated.pega_importexport_pximportexport.pxImportArchive(pega_importexport_pximportexport.java:310)

Comments

Keep up to date on this post and subscribe to comments

Pega
December 9, 2018 - 6:34am

Hi ,

Are you trying to import the RAP of application ?

If so can you please check already a section rule CAPTUREBUSINESSADDRESS is present or not?

seems like its already present in DB.

December 9, 2018 - 6:01pm

The version for which we saw the issue RULE-HTML-SECTION DATA-ADDRESS-POSTAL CAPTUREBUSINESSADDRESS #20181025T012903.313 GMT is a new version of the rule imported. Even though it was present it should just skip the rule and not give the error.