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
Aaron2010Aaron2010 

Error: Failed to invoke future method

System.DmlException: Update failed. First exception on row 0 with id a1H80000000LzOyEAK; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

 

Can anyone of you help me resolving this issue. Everyday i receive 15 emails about this error from ApexApplication [info@salesforce.com]. 

 

Thanks in advance.

AhmedPotrickAhmedPotrick

This error comes when you are performing DML operation on same record that is under processing. You can't perform a DML action on a record that is currently the target of a trigger-- it is locked for editing until the trigger stack completes. May be you can use Future call methods.

Aaron2010Aaron2010

Thanks for your response.

 

Here i am using the future call to update the records. There might be many future calls to update the same record. Here is the complete error

 

Apex script unhandled exception by user/organization: 00580000003IVO8/00D80000000KGj7

 

Failed to invoke future method 'public static void rollupConfCapacity(SET<Id>)' on class 'ConfRollup' for job id '707C0000004nWjk'

 

caused by: System.DmlException: Update failed. First exception on row 0 with id a1H80000000LzOyEAK; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

 

Class.ConfRollup.rollupConfCapacity: line 33, column 9 External entry point

 

Thanks,