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

Frequent entries about posted transaction ID mismatch are logged

SA-11022

Summary



You frequently get log error messages concerning mismatch of transaction IDs.
It does not occur all the time, but when it does happen, it appears to be associated with clicking on the Submit button for the HCSelectMember flow action.



Error Messages



2015-03-04 09:38:15,682 [ WebContainer : 20] [WorkThread] [xxx] ( mgmt.base.ThreadUITransaction) ERROR ...  - ERROR: posted transaction id '5206d2a5f0ffba5b2a60a898bf1d9e4b' for frame 'pyWorkPage' DOES NOT match record 'e9878070e238c9984e5021ff8c027a37'


Steps to Reproduce



Submit the flow action. The error is sporadic in nature.

Root Cause



The root cause of this problem is a conflict between the action of the submit button and a listener that CPM establishes to listen for the button click. Either because of race conditions or customizations, you find that sometimes clicking on the button submits the form multiple times with the associated "transaction id mismatch" error.

The button by default performs a "doFormSubmit" when clicked; in addition, a listener for the click also fires a doFormSubmit.  A Javascript function which runs on load of the harness is supposed to remove the direct action on the button click and add a listener for the button click which instead will submit the form.

The error occurs due to either of the following different conditions:

The function which is supposed to strip the action from the button so that only the listener submits the form cannot find the button in the DOM, and both the button action and the listener submit the form.
(Or)
  Multiple listeners are created, each of which submit the form.



Resolution



This issue is resolved through the following local-change:
Create a custom version of the HTML control AppSubmitButtonSelectRow and replace the contents of the existing control with this:

 
{JAVA}
//Get localized label for alert
saveValueSet("alertSelectRecord", tools.getLocalizedTextForString("pxRequestor.pyMessageLabel","AppSelectRecord")); 
{/JAVA}

{=
<script language="javascript">
var myCounter = 0;
function ValidateButton(e)
{

 if (myCounter <= 0){
      var eve = e||window.event;
      if(!OptionSelected){
         alert("=}{$save(alertSelectRecord)}{=")
         myCounter--;
         return false;
      } 
   myCounter++;
   doSubmit(eve);
   }
}


function SetOnclick()
{
debugger;
var oButton = document.getElementById("submitButton");
if (oButton == null) {
  setTimeout (SetOnclick,250);
}
else {
   pega.util.Event.removeListener(oButton, "click");
   oButton.onclick = "";
   //oButton.innerHTML = "You can now click on this button";
   oButton.innerHTML = "AppSubmitButtonSelectRow Submit"
   pega.util.Event.addListener(oButton,"click", ValidateButton);
  }
}
</script>
=}

<script language="javascript">
var OptionSelected = false;

 pega.util.Event.onDOMReady(SetOnclick);
</script>

 
The changes to the control ensures that if the button is not yet present in the DOM when the function runs, the function continues to try at one-fourth second intervals until the button is found.

Change the name of the button from "Submit" to "AppSubmitButtonSelectRow Submit".  Choose a less offensive name, but still pick one so that your clients can recognize that the "Submit" button has been modified by the script and it is safe to click on it.  
In the very rare circumstance where the name does not update even after several seconds of waiting, the end user must be educated to cancel the current search and start a new one.

The final change to the control is to prevent ValidateButton from submitting the form more than once on a single click.
Suggest Edit

Published July 2, 2015 - Updated December 2, 2021

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