Posted: 18 Jan 2016 14:11 EST Last activity: 18 Jan 2016 20:51 EST
Using explicit "Commit" in standard agent activities- question
Hello, I've a requirement where I've to process request messages asynchronously. I've queuing them to a standard agent so that I needn't handle transnational behavior on multiple nodes in production.
Background: I know Pega OOTB locks the queue entry (instance of System-Queue-DefaultEntry) and also the related object referenced in the queue entry. I see that in "EstablishContext" activity, the related object is opend & locked (with unlock on commit).
Question: For each queue entry, say I've to update 5 work objects and 2 data instances. I would like to commit as and when I update a WO. I do not want to commit all 7 instances at once. So, If I use an explicit commit in the standard agent, I'm afraid that the OOTB lock on the queue entry and the related object referenced in the queue entry will be released. How do I handle this?
Probable solution: I can overwrite the "EstablishContext" activity and I can see that related object is not unlocked on commit. But how do I ensure that the lock on the queue entry is not released on the explicit commit I'm doing? OR may be there is a better a way to handle this???
If you want to commit a particular object, use obj-open-by-handle (or obj-open) with the lock checkmark and when you are ready to commit it, use obj-save with the "write now" checkmark, and then use a page-unlock.
Remember that this is for any objects OTHER than the main object, since that one you should let the system commit for you. /Eric