What is 'UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record' error and how to resolve it?


UNABLE_TO_lOCK_ROW Error

Sometimes emails do not create expected records (or attach with the existing records) and land into the e2a Unmatched Emails queue, showing ‘Insert failed. First exception on row 0: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record’ error as the reason for not being processed.

 

Possible Causes

Generally, this issue arises when more than one operations are trying to acquire a same resource at the same time (Resource contention). Probability of facing this error increases with the concurrency of emails received and if the following automations are in place to process the emails.

  • Triggers
  • Processes/Flows
  • Validation Rules
  • Workflow Rules
  • Rollup Summaries

Solutions

This is a known limitation on the Salesforce platform. However the following tips might help reduce the occurrences of this issue and we wish there was a perfect solution available.

  • Remove automation that is no longer used and is only increasing overhead.

  • Ensure Apex Triggers are as efficient as possible. Using future methods may help as well.

  • Remove all Rollup Summaries that are not needed.

  • Check for any dependent background jobs that are running on the same object. If there is any, try to pause the jobs and then perform the actions to reduce row locks.
  • To avoid the resource contention, optimize/minimize the automations to the best possible extent (which are in place to process the emails).

 

Additional Information:
https://help.salesforce.com/articleView?id=000229525&type=1
https://success.salesforce.com/issues_view?id=a1p30000000T3UYAA0 

 

Our support team would be happy to investigate and help you in finding the root cause if you are facing the same error but not sure what automation is causing the error.


Please contact us at support@ortooapps.com for any questions.

Was this information helpful?
Quick survey: How do you rate Email-to-anything?
★★★★★ - EXCELLENT
★★★★ - GOOD
★★★☆☆OK
★★☆☆☆POOR
☆☆☆☆ - RUBBISH

-