MincheckAffectedRowCountException Error Received

Possible explanations and solutions for the MincheckAffectedRowCountException error.

Explanation 1

If the database data has "\r\n" line endings and if that data is used in an update statement, the data from the Hybrid App control is compared to the database data and they will not match, so an MincheckAffectedRowCountException error is thrown. The Document Object Model (DOM) parser converts "\r\n" at the end of line characters to just "\n" when the Hybrid App message is received from the server.

Solution: In the Custom.js file, add this code to customBeforeSubmit to turn the "\n" back to "\r\n":

var idx;
		var values = workflowMessageToSend.getValues();
		var count = values.getCount();
		var keys = values.getKeys();
		for (idx = 0; idx < count; idx++) {
			var data = values.getData(keys[idx]);
			var dataType = data.getType();
			if (dataType === "TEXT") {
				var value = data.getValue();
				if (value.indexOf("\n") > 0) {
					var newValue = value.replace(/\n/gi, "\r\n");
					data.setValue(newValue);
				}
			}
		}

Explanation 2

The client is specifying outdated values for an update operation, which do not match the values in the back-end data source.

  1. In the WorkflowClient log, if you see com.sybase.vader.da.jdbc.MinCheckAffectedRowCountException, check the preceding line, which should include JsonContent.

    This line contains the old values that are being sent from the client.

  2. Check these values against the outdated values in the back-end data source, determine which are different, and make appropriate changes.