Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

DuplicateKeyException Running multiple File Listeners

SA-34117

Summary



Two File Listeners are running and each of these have their own unique file path.

These File listeners are creating work item depending on several business conditions by invoking pxCreateTopCase, an Out-of-the-box (OOTB) activity.

When both listeners are creating work at the same time, sometimes duplicate work object IDs are being created and this is resulting in errors.

JBoss and SQLServer 2012 are in use.


Error Messages



Error in commit()
com.pega.pegarules.pub.database.DuplicateKeyException: Violation of PRIMARY KEY constraint < Primary KEY Name>. Cannot insert duplicate key in object <Work Table Name> The duplicate key value is <PZINSKEY>


Steps to Reproduce



Execute two or more File Listeners at the same time using JBoss and SQLServer 2012.


Root Cause



The Pega code calls DatabaseImpl.setAutoCommitOffAndStartTransaction(aConn); which is meant to set autocommit to false, however this was not working as expected. An additional JBoss datasource setting is required for this to work properly.

Resolution



Make the following change to the operating environment:

Add jta=”true” to the Pega datasources in JBoss. For example:

<datasource jta="true" jndi-name="java:/jdbc/AdminPegaRULES" pool-name="AdminPegaRULES" enabled="true" use-ccm="false">

Published March 1, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us