Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

Mule 4 Salesforce Upsert Error "Unable to obtain exclusive access to this record" and "UNABLE_TO_LOCK_ROW"

公開日: Mar 18, 2026
説明

In Mulesoft, when trying to UPSERT records in a Salesforce Object, the records are getting locked.

After enabling Salesforce DEBUG logging (by following this Knowledge Article), you will see something like the following in the application log:

DEBUG 2020-03-26 11:18:35,857 [[MuleRuntime].io.03: [htb-salesforce-diff-process-api00248611].htb-salesforce-diff-process-upload-accounts.BLOCKING @7378920d] [event: 05ebe7d0-6f73-11ea-8a35-24418cf673a5] org.mule.extension.salesforce.internal.connection.provider.ConnectorConfigBuilder: Receiving response from https://haventreebank--uatfull.my.salesforce.com/services/Soap/u/47.0/00D4g0000008y62
DEBUG 2020-03-26 11:18:35,857 [[MuleRuntime].io.03: [htb-salesforce-diff-process-api00248611].htb-salesforce-diff-process-upload-accounts.BLOCKING @7378920d] [event: 05ebe7d0-6f73-11ea-8a35-24418cf673a5] org.mule.extension.salesforce.internal.connection.provider.ConnectorConfigBuilder: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header><LimitInfoHeader><limitInfo><current>2443</current><limit>5000000</limit><type>API REQUESTS</type></limitInfo></LimitInfoHeader></soapenv:Header><soapenv:Body><upsertResponse>
<result><created>false</created><errors><message>unable to obtain exclusive access to this record or 28 records: 001f100001NuTxXXXX,001f100001NuYcXXXX,001j000000YaLXXXX,001j000000IO3HXXXX,001f100001MSRDfXXX,001j000000IO3J1XXX,001j000000J0030AAB,001f100001NudDr,001f100001MSS1y,001f100001MSWmj, ... (18 more)</message><statusCode>UNABLE_TO_LOCK_ROW</statusCode></errors><id xsi:nil="true"/><success>false</success></result>
<result><created>false</created><errors><message>unable to obtain exclusive access to this record or 28 records: 001f100001NuTxXXXX,001f100001NuYcXXXX,001j000000YaLXXXX,001j000000IO3HXXXX,001f100001MSRDfXXX,001j000000IO3J1XXX,001j000000J0030AAB,001f100001NudDr,001f100001MSS1y,001f100001MSWmj, ... (18 more)</message><statusCode>UNABLE_TO_LOCK_ROW</statusCode></errors><id xsi:nil="true"/><success>false</success></result>
<result><created>false</created><errors><message>unable to obtain exclusive access to this record or 28 records: 001f100001NuTxXXXX,001f100001NuYcXXXX,001j000000YaLXXXX,001j000000IO3HXXXX,001f100001MSRDfXXX,001j000000IO3J1XXX,001j000000J0030AAB,001f100001NudDr,001f100001MSS1y,001f100001MSWmj, ... (18 more)</message><statusCode>UNABLE_TO_LOCK_ROW</statusCode></errors><id xsi:nil="true"/><success>false</success></result>
...
解決策

Using MuleSoft, when the error UNABLE_TO_LOCK_ROW is detected on the Salesforce side, that indicates the desired Salesforce record was locked by other sessions during the bulk update.

Please refer to the below Salesforce Help doc for more detail:
Salesforce Help: Unable to lock row - Record currently unavailable errors

The error itself is not a defect; it just indicates the record was locked. With Mule 4, the lock error should be investigated from Salesforce perspective, but here are some generic assumptions.

To reduce the frequency of the error, there are two points to consider:

1) Reduce the processing time for the update transaction. As the update transaction completes quickly, there will be a lower risk of being locked.

- By reducing the batch size, it will decrease the number of records to be updated in one transaction, so update transaction time will be reduced.
-  Are there Apex triggers associated with the desired Salesforce record/object? Look into such Apex triggers if there are some triggers that may cause a longer time to complete the update.

2) Reduce the possibility of concurrent updates to related records

- Is there a parent/child relationship on the desired Salesforce record/object, such as Account and Contact, and some custom Salesforce objects, etc.? Please look into your Salesforce transaction during the bulk update that may update such related/parent/child records to reduce the risk of lock contention.
- Also, if you have associated Apex triggers to the desired record to be updated, check if there are any other Salesforce objects to be updated by the trigger and avoid updating such objects during your bulk update.

ナレッジ記事番号

001122237

 
読み込み中
Salesforce Help | Article