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
willardwillard 

unable to obtain exclusive access error on INSERT

So here's my scenario.

 

  • I am updating 400 Subscription rows via an API call (all rows updated successfuly)
  • Each update is for a different subscription (no overlaps)
  • There is one trigger on Subscription that calls a Batch job (once for every trigger invocation, i.e., runs twice for 400 updates)
  • The batch job takes each subscription and creates an Opportunity off of it.  There are no updates to opportunities in this batch job.  One thing to note is that I am using Database.insert(objs) and not insert objs
  • I have turned off all triggers on the Opportunity to ensure this was not causing the error

I am still getting the "unable to obtain exclusive access to this record" error.  I can't figure this out since these are inserts.  Why would it be giving me this error when there is currently no row to lock?