salesforcejsforce

Concurrency limitations for Salesforce API?


I am running this code that uses jsforce to interact with Salesforce API.

In two different steps, one upserts into a collection, and the next step would require finding the object again in the collection. I'm failing to trigger the 2nd step occasionally, and according to my logs in these failure cases, the 2nd step triggered before the 1st step (upsert) responded.

I'm suspecting that Salesforce isn't allowing me to read that object when another operation is concurrently updating it. Is this an expected behavior?


Solution

  • Apparently, I can simply wait for the 1st request to respond before proceeding or add an arbitrary timer prior to firing off the 2nd request to bypass this problem.

    Marking this as solved as I've filed the question in the library's repository: https://github.com/jsforce/jsforce/issues/1177