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

How to ensure that process Id is unique

SA-19757

Summary



User requires to know how to ensure that processEngine is generating a unique Id for every process.


Error Messages



Not Applicable.


Steps to Reproduce



Not Applicable.


Root Cause



How to question on PID generation.

Resolution




PID is calculated as shown below:
 
  • newPid = staticPidBaseSeqNum * 1000L + staticPidCntNum;
  • staticPidCntNum += 1L;
  • newPid *= -1L;
 
When SEEDNUMSEQ  is less than 2147483:
 
In any point of time , staticPidBaseSeqNum holds the current SEEDNUMSEQ  sequence value. On the first call to getNextStaticPID(), after the server restart,  SEEDNUMSEQ will be incremented.
Starting from zero, staticPidCntNum will be incremented by 1 for every invocation of getNextStaticPID(). Once it reaches 999, SEEDNUMSEQ will be incremented and staticPidCntNum will reset to zero.
 
 
When SEEDNUMSEQ  reaches  2147483:
 
  1. staticPidBaseSeqNum will be rolled over to zero and will not hold the current SEEDNUMSEQ  sequence value.
  2.  Then on, the first call to getNextStaticPID() after the server restart or staticPidCntNum reaches 999, staticPidBaseSeqNum will be incremented.
    Note: SEEDNUMSEQ will be incremented too.
  3. Starting from zero, staticPidCntNum will be incremented by 1 for every invocation of getNextStaticPID().
  4.  staticPidBaseSeqNum will be rolled over to zero again, once it reaches 2147483L.
 
 
User can see duplicate PIDs once SEEDNUMSEQ  exceeds 2147483 and triplicate PIDS once SEEDNUMSEQ  exceeds 4294966(2147483*2).
 

 

Suggest Edit

Published March 1, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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