Support Article
"Batch failure" error on Connect SOAP calls
SA-16146
Summary
When the system calls a SOAP service and creates work items, it encounters an error:
Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch.
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null
Error Messages
2015-10-22 15:45:13,038 [ WebContainer : 1] [ STANDARD] [ ] [ ] (WithErrorHandling.Work_.Action) ERROR Your_host|127.0.0.1|SOAP|CreatePortalCase|pyStartCase|PortalCaseCreate - Error in commit()
com.pega.pegarules.pub.database.DatabaseException: [ ][ ][ ][ ][ ] Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch.
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null
From: (A15182F2A8E6B5319387BCC5BEDA43DC9:CreatePortalCase)
SQL: MERGE INTO DATA.pr_data...
Steps to Reproduce
Call a SOAP service and generate work objects.
Root Cause
Starting in Pega 7.1.7, a new API is introduced that results in non-deterministic order of database SQL statement execution within a transaction.This error occurs when there is an instance that is the target of a foreign key constraint, which must be inserted, before the instance, which has the primary key constraint. Due to the non-deterministic ordering behavior, this does not always occur, this is not always the case because even though the save operations may be called by the application in the correct order, the batch is made as a deferred commit.
Resolution
See Support Article http://pdn.pega.com/node/344276
A configuration change can be made to enforce strict ordering of the batch update commits when it is necessary due to your foreign key structure.
The mentioned Support Article makes this solution directly in the prconfig.xml file, but it can also be performed by Dynamic System Setting which may be preferable.
Owning Ruleset: Pega-Engine
Setting Purpose: prconfig/database/batchUpdates/default
Value: -1
Remember that dynamic system settings (as well as prconfig.xml changes) takes effect only at system startup. Restart the system after applying the configuration change.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.