function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KIBLKIBL 

What is the best way to determine why we are sporadically getting an error "unable to obtain exclusive access to this record"?

What is the best way to determine why we are sporadically getting an error "unable to obtain exclusive access to this record".  We get it at times when we use the dataloader to delete records, delete a record manually, send an email, create a case in Salesforce, or create a case from Lightning for outlook.  Salesforce Basic Support directed me here.  Where do I start? 
KrishnaAvvaKrishnaAvva
Hi KIBL,

This has been solved here. https://success.salesforce.com/answers?id=90630000000gyWPAAY
Please mark this as SOLVED if it had helped you. Thanks!

Regards,
Krishna Avva
KIBLKIBL
Thanks! We tried this already with the dataload and it did not work. This does not help with the manual delete, create a case, or send email. [KI] BECKY LUECK | Business Analysis Manager P: 920.406.3393 | E: becky.lueck@ki.com | ki.com [Facebook] [Twitter] [Youtube] [LinkedIn] [Pinterest] [Instagram] [BON Awards]
KrishnaAvvaKrishnaAvva
Hi KIBL,

Got it. Its quite generic with manual delete, create a case and send email etc. You get the error mostly because of multi threading or record lock. We have to follow best practices in the code to find the exact reason for the issue. I would suggest that you pick up the most frequesnt error enable the debug logs with finer aspects and debug the process flow.

Regards,
Krishna Avva
KrishnaAvvaKrishnaAvva
Few examples :
  • Sharing Rules are being calculated.
  • A picklist value has been replaced and replacement is in progress.
  • A custom index creation/removal is in progress.
  • Most unlikely one - someone else is already editing the same record that you are trying to access at the same time.