Posted: 24 Jun 2015 11:21 EDT Last activity: 18 Jul 2017 10:41 EDT
Enable disable Data Agent Queue records
We are in the process of enabling / disabling Data-Agent-Queue instance records using a set of agents. We have some exception scenarios where we would like to perform some bulk functionality on cases that have been incorrectly created in the system. In order to prevent manual intervention from Production support user, we are trying to enable disable a set of agents which will perform the required functionality when such exception scenario occurs. We have one set of 8 agents started, each agent does some processing and queues the cases to a second set of agents. At that point it enables the corresponding second agent by enabling the corresponding Data-Agent-Queue record. The issue we observed is since we cannot obtain locks on the instances of the Data-Agent-Queue class, we sometimes run into race condition which results in data integrity issue.
We are looking at option of receiving a hot fix to have the "Allow Locking" check box checked on the Data-Agent-Queue class. This will help in locking instances of this class, when try to open these instances using Ibj-Open methods.
***Updated by moderator: Lochan to close post*** This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
I don't think this can be hot fixed. You are requesting for an enhancement. Please reach out to Global Customer Support to raise the enhancement request or talk to your Pega Account Executive.
You could use the following Java code to get a lock and to release it. Use this to avoid race conditions. Note that here you are trying to acquire a lock for a specific string as highlighted in red below.
booleangotLock = tools.getDatabase().getLockManager().acquireLock("MyLockForAgentA", false, new HashStringMap()) == LockManager.LOCK_ACQUIRED;