Topic
  • 5 replies
  • Latest Post - ‏2014-01-09T16:49:29Z by Katherine Sanders
Sathishvenks
Sathishvenks
1 Post

Pinned topic Best practice for Failure Scenarios

‏2013-05-13T09:22:17Z |

Hi,

I would like to get an opinion on the best practices we should follow for failure scenarios in the orchestrations

For Example, I have 500 records to process from db to Salesforce with batch size as 200. Now lets say the activity in the orchestration fails at 450th record.(Maybe connectivity issue). So in this case the entire transaction will be rolled back and the 500 records will not be inserted/updated into Salesforce. So how could I trace this 500 records which were part of  failed scenario? One possible solution I could think of is maintaining a separate table and push all the records to that table.

Is there any other general practice available to handle such type of scenarios?

Also please provide any links or tutorials if you have any on this topic. 

Thanks.

  • SivaKumarKothakota
    SivaKumarKothakota
    1 Post

    Re: Best practice for Failure Scenarios

    ‏2013-10-21T20:53:23Z  

    Instead of inserting to database, maintain a variable which it increments for every iteration.When any record insertion fails then display the iteration number of the failed insertion.

     

    Thanks !

    SivaKumar

  • Vinod_Valecha
    Vinod_Valecha
    1 Post

    Re: Best practice for Failure Scenarios

    ‏2013-10-22T06:33:04Z  

    Hi Satish,

    You can refer to the chapter 9 of the below redbook. It mentions the how to use an orchestration for handling errors in the same manner
    across multiple orchestrations and how a common error handler orchestration can be used by the other orchestrations.

    Also you can go through Chapter 10, it explains a synchronization scenario similar to your scenario.

    http://www.redbooks.ibm.com/redbooks/pdfs/sg248004.pdf

    Thanks,

    Vinod Valecha

  • Katherine Sanders
    Katherine Sanders
    3 Posts

    Re: Best practice for Failure Scenarios

    ‏2013-10-28T13:32:41Z  

    Hi Satish,

    You can refer to the chapter 9 of the below redbook. It mentions the how to use an orchestration for handling errors in the same manner
    across multiple orchestrations and how a common error handler orchestration can be used by the other orchestrations.

    Also you can go through Chapter 10, it explains a synchronization scenario similar to your scenario.

    http://www.redbooks.ibm.com/redbooks/pdfs/sg248004.pdf

    Thanks,

    Vinod Valecha

    "For Example, I have 500 records to process from db to Salesforce with batch size as 200. Now lets say the activity in the orchestration fails at 450th record.(Maybe connectivity issue). So in this case the entire transaction will be rolled back and the 500 records will not be inserted/updated into Salesforce."

     

    I'd just like to point out that the entire "transaction" would not be rolled back in this case.  If an exception occurred at record 300 and your batch size is 200 for 500 total records, the first batch would be processed successfully, it's only the second batch that would fail.  Depending on your error handing, the third batch may also be processed.

     

    Please also note that there are two types of errors from Salesforce: 1. Exceptions such as connectivity issues - these should be caught in a try catch activity or the catch all branch for the orchestration and 2. Errors such as invalid data in one record - these are returned in the salesforce results object, you should inspect the results in your orchestration and handle these errors too.

     

  • SwethaRai
    SwethaRai
    1 Post

    Re: Best practice for Failure Scenarios

    ‏2013-12-24T06:42:24Z  

    "For Example, I have 500 records to process from db to Salesforce with batch size as 200. Now lets say the activity in the orchestration fails at 450th record.(Maybe connectivity issue). So in this case the entire transaction will be rolled back and the 500 records will not be inserted/updated into Salesforce."

     

    I'd just like to point out that the entire "transaction" would not be rolled back in this case.  If an exception occurred at record 300 and your batch size is 200 for 500 total records, the first batch would be processed successfully, it's only the second batch that would fail.  Depending on your error handing, the third batch may also be processed.

     

    Please also note that there are two types of errors from Salesforce: 1. Exceptions such as connectivity issues - these should be caught in a try catch activity or the catch all branch for the orchestration and 2. Errors such as invalid data in one record - these are returned in the salesforce results object, you should inspect the results in your orchestration and handle these errors too.

     

    Hello Katherine,

    This information helps. Need more help.

    Could you please confirm if in a batch of 200, if the first/second record fails , we can still see the rest of the 98 records getting successfully upserted to SFDC right? in that case we are not actually rolling back the 200 record batch as well.

    below is a sample screenshot attached.

  • Katherine Sanders
    Katherine Sanders
    3 Posts

    Re: Best practice for Failure Scenarios

    ‏2014-01-09T16:49:29Z  
    • SwethaRai
    • ‏2013-12-24T06:42:24Z

    Hello Katherine,

    This information helps. Need more help.

    Could you please confirm if in a batch of 200, if the first/second record fails , we can still see the rest of the 98 records getting successfully upserted to SFDC right? in that case we are not actually rolling back the 200 record batch as well.

    below is a sample screenshot attached.

    As I said above there are 2 types of errors in salesforce.  The errors in your screenshot are type 2, so the rest of the records would be upserted successfully.  You need to look at the results where success = false and handle those errors yourself (for example log them or send an email alert).  Those errors are usually due to data quality and require human intervention to fix them (in your screenshot the number is too large for the salesforce field).