In Queue processor I am creating a child case using pxAddchildwork
But when I enable commit checkbox. It is showing error as “ORA-00001: unique constraint (PEGADATA.PC_ERI_GLOBAL_EMATCH_WORK_PK) violated”
how to solve this?
When creating a child case using pxAddChildWork inside a Queue Processor, pxAddChildWork initializes the child case page and handles its internal ID generation. If explicit Commit / Obj-Save steps or the Commit checkbox are triggered inappropriately within an asynchronous Queue Processor thread, you are trying to perform the commit twice on the same Page. Hence the error. pxAddChildWork internally marks the new case page for save. Calling an explicit commit while the page context is already in the deferred save queue can cause the engine to attempt duplicate INSERT statements for the same pzInsKey.
Let the Queue Processor complete its execution path naturally. Pega’s transaction manager automatically processes deferred saves and issues a single pxCommitTransaction at the end of the Queue Processor execution turn.
A Queue Processor automatically commits the transaction when the queued item completes successfully.