Skip to main content

I have a requirement to read data from Salesforce, create a CSV file at a SFTP server; post the successful creation of flat file at SFTP, need to update the status of records in Salesforce.

 

My mule flow gets kicked off with the help of a http listener. I have incorporated SFTP write and Salesforce update with in a try scope, set transactional action as "Always_Begin" and type="Local(Default)".

 

The intention here is that, either both SFTP write and Salesforce update should happen or none. But in my case, if my Salesforce update fails, the SFTP write isn't getting rolled back.

 

Not sure, how to go ahead with this. Any help here would be great !

1 réponse
  1. 1 mars 2020, 15:58

    HI @Venkata Srilatha Tadikamalla​ ,

     

    Rollback will be used only if you have managed the transactions properly. Few points I have here for you reff:

    1. SFTP and Salesforce doesn't support transactions(Local/XA), as they are not two phase commit systems.
    2. Due to point no. 1, you can't set transnational action properties in your these components. Just because of this reason your both operations will not participate in transaction.
    3. Due to unavailablity of transactional action here, it would be better to take help of either reliability pattern( https://docs.mulesoft.com/mule-runtime/4.2/reliability-patterns) or saga patterns.

     

    Regards,

     

    Lalit Panwar