cancel
Showing results for 
Search instead for 
Did you mean: 

Exception in ForEach block causes it to stop

Former Member
0 Kudos

My scenario is a JDBC to JDBC to File scenario. The JDBC sender returns a resultset of a few transaction Ids. I then need to call a SP with each transaction id one by one to return more details. I am doing this by going to BPM, splitting the transaction ids and in a ForEach block using a synchronous send to call the SP and return the result set and then a recieve step to output to a file.

This approach works fine until there is an exception in the SQL call. The response returns something similar to below and causes an exception.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Inbound Message

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP.GetSAPInvoiceInfo' (structure 'STATEMENTQuery'): com.microsoft.sqlserver.jdbc.SQLServerException: Validation-SAP CostCenter not found for LONDON</SAP:AdditionalText>

<SAP:Stack />

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

This will happen every now and then so I want to keep the foreach block going but the process is stopped and no other records are processed. I have added an exception branch and everything but still no luck. Any ideas? Is this possible?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I have tried ParForEach as well and I still get the same behavior. If there is an exception they are all stopped. Any reason why this would be?

prateek
Active Contributor
0 Kudos

ForEach usually follows sequential behavior. Try using ParForEach instead.

Regards,

Prateek

Former Member
0 Kudos

Anyone have any experience with this? Thanks

Former Member
0 Kudos

ParforEach would work for this. It executes all messages in parallel. We are also using same.

Regards

Sushil