+ Start a Discussion

Concurrency/record locking on the REST API?

Do you get the Salesforce concurrency/record locking when your using the REST API? I'm assuming not.

Record locking works with the REST API the same as it does with any other interface to salesforce.com. It's true that it's possible for a REST API call to overwrite another's changes during a query -> do something -> update cycle, but if two edits reach the database at the same time, one of them will get the usual UNABLE_TO_OBTAIN_ROW_LOCK error. This is easily noticeable when there are long transactions that occur on the record so you can test it (for example, creating a trigger that locks up the transaction for 7-8 seconds, you can launch a second update that will fail). The UI also respects row locking, and will notify a user when a change has been made to a record while they were working on it in order to avoid overwriting the data.