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

Case creation agent navigates to the broken queue

SA-88789

Summary



A Message Queue (MQ) Listener creates a case and sends it to another listener for processing. Intermittently, data from the created case is missing. An error does not display or generated in the logs.


Error Messages



Not Applicable


Steps to Reproduce

  1. Use the Queue- For-Agent method to queue an entry for the case creation agent.
  2. Configure the agent to run on a regular interval.


Root Cause



An issue in the custom application code or rules.
Although Pega manages most of the locking (and the database transaction itself) using Bean Managed Transaction (BMT), MQ listeners use the Container Managed Transaction (CMT). A major difference between the modes is that for CMT, the lock is released immediately upon receipt of the Commit request, before the actual commit. With the lock is released but the work object is not yet committed, another process can lock and receive a stale copy of the work object. Eventually overwriting the change that was in process.



Resolution



Perform the following local-change:
  1. Do not use the option 'Release-on-commit' when opening the work object, if the MQ Listener uses CMT processing to perform the work .
  2. Manually release all the locks with an explicit call to WorkUnlock after the commit. If a call is made to an out-of-the-box routine which uses the 'Release-on-commit', add a Obj-Refresh-and-Lock step after that and leave the 'Release on commit" unchecked. The process must check if it actually obtained the lock since the same Race condition can occur and it fails to obtain the lock.
Note: If custom timeouts are used for locking (for example, case types have their own locking intervals), then the LockInfoPage (classless) which Obj-Refresh-and-Lock uses can be utilized to specify the unique timeout. Add the property TimeOut_ClassLevel prior to the call and set it to the desired timeout value.

Even if the work object is already locked in the 'Release on commit' state, Obj-Refresh-and-Lock switches the Lock state to the 'Not release on commit' if the process leaves the box unchecked.

Published February 11, 2020 - 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