I have a trigger and I am calling a queueable job from trigger. Sometimes I get this error:
Update failed. First exception on row 0 with id a0VN00*********; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 200 records:
Below is my query before updating the recods:
list<MyObject> lst = [select id, Account_Id__c from MyObject where
Account_Id__c in:setofAccountID FOR UPDATE];
I have referred to Can anybody explain the UNABLE_TO_LOCK_ROW error? and used FOR UPDATE
.
Still, I get the error.