You need to sign in to do that
Don't have an account?
Surender reddy Salukuti
System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 1 records:
Hi Every one,
when i am executing test class i am geeting the error like below can any one help me .
Error message
System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 1 records:
when i am executing test class i am geeting the error like below can any one help me .
Error message
System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 1 records:
Greetings!
When the same test class is being edited by any other user while you are trying to run the test class then this error occurs.So,I would suggest you to try again later or check if any other user is trying to modify at the same time to avoid error.
Reference:https://www.infallibletechie.com/2020/04/unabletolockrow-unable-to-obtain.html
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Hi Surender,
Your record is getting processed from multiple classes/jobs. Try to create you own test records for corresponding test class.
Hope this helps!
Thanks,
Sucharita