Webservice Callouts within a Select For Update statement are not blocked
Last updated 2018-11-06 ·Reference W-2814934 ·Reported By 9 users
With a http callout in the For Update method, the record locking for that transaction will be removed before the transaction completes.
1. create a simple VF page and a controller that makes use of "For Update"
2. Create two submit buttons in the VF page, one that makes a callout on submit and one that process without a callout in the "For Update" process.
3. Simulate a long running request with the help of a delay loop within the for update
4. Now try the below steps
Access the VF page with any account id parameter.
Keep the VF page open in two different tabs
Give input parameters and click "without callout" button in both the tabs immediately one after other.
- this will give "Record not available error" when the locking is in place
Now try the "with callout" button on the two tabs.
- the record gets updated successfully.
5. The debug logs captured, clearly show for the without callout transaction the request waits for more than 10 seconds and then errors out with a "Record not available" exception.
6. For a with callout, the record gets updated successfully.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.