Questions tagged [locking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
30 views

UNABLE_TO_LOCK_ROW

Error while saving Quote Lines:SBQQ.ValidationException: [": execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable ...
4
votes
2answers
77 views

SOQL - concurrent reads of rows when FOR UPDATE clause is used

Below is our scenario: We have a requirement to tag unique number to self service applications which are created through customer community. We tried to use salesforce auto number but our client had ...
4
votes
0answers
42 views

Is this a good Model for “Guaranteeing” Record Updates Don't Fail due to ROW_LOCK/Race Conditions?

Background: The zqu__Quote__c object in our org has two child objects from another managed package we use for eSignature and credit card capture. One of those two child objects collects the Credit ...
3
votes
1answer
61 views

Does locking of account lock related contact during insert?

I have a WSDL Apex service that consumes XML and creates a series of objects. XML received and parsed, queries for and finds a single account "Potential Customer" to relate potential customer ...
4
votes
1answer
61 views

Is there a way to prevent SOQL from returning records that have been locked with FOR UPDATE?

If I have a class that is using FOR UPDATE to lock a record. Is there a way to prevent another instance of that class from calling those records that have been locked before the previous class is done ...
1
vote
1answer
22 views

Is there any locking of cases or delay in CRUD operations after updating case assignment rules?

If I update case assignment rules are there any locking or differences such as query delays that I should consider? The documentation does not specifically list update assignment rule considerations ...
3
votes
1answer
51 views

Does the FOR UPDATE field apply to reference fields?

If do a query like [SELECT Opportunity.Name, Product2.Name FROM OpportunityLineItem FOR UPDATE], is the Opportunity and Product2 locked, or just the OpportunityLineItem? I'm trying to set a field on ...
4
votes
1answer
186 views

Avoid new record race conditions with FOR UPDATE [closed]

Under simple circumstances FOR UPDATE does only respect records that existed when the query was executed. But I need all available records matching my query when the transaction proceeds. Let me ...
4
votes
2answers
140 views

Spin locks with variable time retry backoffs

Use Case After insert triggers start Queueable Queueable execute() contends for same resource, uses spin lock to wait for resource availability. Many queueables could be running at same time. ...
1
vote
0answers
35 views

Locking Attachment During Approval Process is failing

I am trying to lock the Attachments related to a custom object using the below 2 lines of code, when the custom record is under approval process. But I am getting an error as: "System....
3
votes
1answer
654 views

Bulk API Error: UNABLE_TO_LOCK_ROW:unable to obtain exclusive access to this record or 124 records

During the process of loading 90,000 opportunities into Salesforce using the Bulk API, I get this error: UNABLE_TO_LOCK_ROW:unable to obtain exclusive access to this record or 124 records... After ...
1
vote
0answers
33 views

Record Lock Issue for REST endpoint

I have built a REST endpoint, which writes data(Accounts) to Salesforce. Currently, for a single record, there could be multiple (20-30 times) upserts within 1-to-5 seconds. Behind the scenes, it's a ...
1
vote
2answers
166 views

User hits record lock error despite class without sharing

My users keep hitting a record lock error despite the class being defined as without sharing. My understanding is that without sharing allows locked records to be edited by any user. This class is the ...
7
votes
1answer
293 views

Apex Approval.lock, programmatic locking and record editability

Background: In Winter '16, Salesforce introduced the Approval class for setting approval locks and unlocks through Apex (release notes). Since then, my company has been leveraging this functionality ...
0
votes
1answer
552 views

Records are not getting locked with “Approval.LockResult” class

On Using "Approval.LockResult" class, In debug logs i can see the records are successfully locked but in reality the records are not saved and i cannot even see the lock/unlock button on record detail ...
0
votes
2answers
46 views

Locking rows at the last minute

I have a utility routine (pasted below) that I use for all writes to the database which lets me catch errors. This works perfectly in all but one of my orgs. In that org, I generate a ton of ...
0
votes
0answers
22 views

Validation Rule to “Lock Up” UTM Fields on Opportunity when the Opportunity is created [duplicate]

I am trying to lock the UTM fields on an opportunity when it is created. I would the field to not be able to be edited by anyone (including Marketo Sync User) other than a system admin after the ...
0
votes
1answer
111 views

Tasks Updates--Locking issue

We are currently facing issue while updating tasks via dataloader or workbench. We are updating tasks of around 8 lakhs. Problem is tasks are linked to account which locks the accounts while updating ...
6
votes
1answer
748 views

Users getting “Unable to obtain exclusive access” Error

My users are attempting to work in records and occasionally get the error message of Unable to obtain exclusive access to this record or 1 records: [id]. This error is intermittent and I cannot find ...
1
vote
2answers
404 views

Salesforce Bulk API Unable to lock row

I'm currently using the Salesforce Bulk API within a Rails app to update a custom object in Salesforce. This works fine when I send a single record through, but when I batch in sets of 200, I get ...
1
vote
1answer
96 views

Process multiple inbound requests in parallel

I have an inbound interface in my Salesforce org, it updates existing account records. The inbound interface being called by number of third party systems. Whenever two different requests try to same ...
10
votes
1answer
167 views

FOR UPDATE returns old values

I use FOR UPDATE locking in a query but when the first execution completed, the second execution (started while records were locked) seems to use the old data set. I played around for a while and ...
1
vote
1answer
569 views

Lock and Unlock opportunity object during approval process

I have an approval process for the Opportunity object. But I want to unlock a record during this process to add a very important information that can only be obtained later and then lock the record ...
0
votes
0answers
344 views

Unable to lock row - Record currently unavailable error

I know there has been lot of things available online for record locking errors but I am putting my analysis based on client issue that we are facing, would appreciate if I can get any thoughts. We ...
0
votes
1answer
104 views

How to skip transaction locked record in SOQL

Consider multiple processes are accessing a set of frequently updating records and they pick whatever matches certain criteria. They should lock those picked up records. So almost at the same time if ...
0
votes
1answer
214 views

UNABLE_TO_LOCK_ROW during send email

I have a code where I send email using single email message. I am setting targetObjectId as a contact Id. I am getting the following error: System.EmailException: SendEmail failed. First ...
0
votes
1answer
136 views

Relock record after approval process

Is there a way to re-lock a record immediately after it has been approved via an Approval Process (in the same transaction)? It seems like a simple thing to do via a Trigger but I have an After ...
7
votes
1answer
429 views

Optimistic locking when working via REST API

I have a case when SF data can be updated concurrently by humans with UI and by a Ruby app via REST API, so I'm worried about the possibility they overwrite changes of each other. Is there a standard ...
3
votes
0answers
87 views

Resolving UNABLE_TO_LOCK_ROW issue

Is there any way to identify which transaction/class took the lock the record when we get this UNABLE_TO_LOCK_ROW issue. Simply giving UNABLE_TO_LOCK error and not giving the idea about he potential ...
0
votes
1answer
520 views

how did Record lock in salesforce in my scenario and how to avoid it?

we have a scenario where User role is changes we have to update Account field then Account's trigger will update 5 related objects so their triggers also fire :) . Earlier we have used process builder ...
1
vote
1answer
92 views

Apex Approval Process Locks on DML Statements

I have a custom button on a record which is designed to update the record's status. There is a separate process within a different class, which is locking the record. I need my pageRef to unlock the ...
1
vote
1answer
371 views

Waiting for a record to be unlocked in Apex

As You know how we can lock records in Apex by adding a FOR UPDATE at the end of SOQL query. In one of my classes I have to query for a bunch of records and then updating them. In this query I use ...
1
vote
1answer
55 views

Is it possible to have a validation rule with a finely nuanced loophole to create and modify detail records?

We have Opportunity with a custom checkbox property "Locked__c". While this value is set to true (never mind how), it should be impossible to change any value on the Opportunity. The Opportunity has ...
4
votes
1answer
518 views

SObject type does not allow locking rows

I am trying to update a group of records satisfying certain conditions it was giving me Error which says:- UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 10 records so ...
1
vote
0answers
100 views

Challenge unlocking a list of objects in my logic

I am trying to using Approval class to lock and unlock records of an object xyz__c. When I run the below code I still see the record as locked and unable to perform update on it: List<xyz__c> ...
1
vote
1answer
1k views

Unlocking and locking a record in approval process in one Transaction

In this scenario I have two object Foo__c and zoo__c. Whenever a particular field in Foo__c is updated it should update certain fields in zoo__c object. My problem : Some of the zoo__c records can ...
2
votes
0answers
266 views

Group membership locks - Territory Hierarchy updates & Sharing recalculations

I read through the Record Locking Cheat Sheet to understand record locking concepts and have some follow-up questions: What can be the cause of Group membership locks with relevance to Territory ...
3
votes
2answers
2k views

Implicit sharing & Record locking

I am trying to understand if Implicit sharing capability can be used to avoid record locks or increasing performance of update operations on master-detail records. I am referring to this link here. ...
7
votes
1answer
403 views

GroupMember locking

For out project we need to put users into correct public groups. This happens in a trigger when a user's contact is updated, depending on some of the fields there we decided where to put a user. The ...
0
votes
1answer
483 views

How to make accounts read-only / locked?

It's a long story, but we have a group of account in SF that we'd like to make read-only. Ideally, these records would... Remain accessible to the same people they were before No longer be editable ...
9
votes
2answers
2k views

The cause of UNABLE_TO_LOCK_ROW error?

My scenario is as followed, I have a single Parent account with about 600 child accounts. Every child account has a single Opportunity with 2 or more lines. I have a monthly batch job to create ...
2
votes
0answers
328 views

Checking Object Lock status using REST API

We are running into the object lock contention UNABLE_TO_LOCK_ROW error when attempting to create a record in the CampaignMember object using AMPscript in Marketing Cloud due to the high lock ...
0
votes
1answer
238 views

Organization Administration Locked

good old message is the following : Organization Administration Locked The changes you requested require salesforce.com to temporarily lock your organization's administration setup. However, ...
2
votes
0answers
977 views

CreateSalesforceObject AMPscript function and Record Locking Concurrency

We are using the CreateSalesforceObject AMPscript function to create a new record in the Salesforce CampaignMember Object when an email is sent, by including the following code in an email: set @...
1
vote
1answer
573 views

Causes of organization lock

I recently tried to deploy some changes between sandboxes using the Force.com migration tool and got the following error: Failed to process the request successfully. Cause(ALREADY_IN_PROCESS): null:...
1
vote
1answer
536 views

Can a future method conflict with a queuable method?

My custom code is executed using a queuable class. Sometime it runs perfectly, other times it gives this error: Failed to update list. Error: System.DmlException: Update failed. First exception ...
9
votes
1answer
177 views

Will a DML ever lock a “grandparent” record?

Let's say I have two levels of master-detail relationships. Grandparent object is master-detail to Parent obj, which is in turn master-detail to Child object. I have an existing Granparent record G1....
5
votes
2answers
170 views

Pessimistic Lock Released after Callout

The documentation says: The lock gets released when the transaction completes. However I can validate that it also gets released when a callout is made! Here a two test methods: public static ...
6
votes
2answers
1k views

Disable Parallel Test vs. Always Run Asynchronously in Dev Console - Who wins?

I love to run my tests in the Dev Console with the Always Run Asynchronously checkbox enabled as it saves time. On the other side during our automated Nightly Test run I would like to disable ...
11
votes
1answer
2k views

When is a FOR UPDATE lock released?

The Salesforce docs say that The lock gets released when the transaction completes Does that mean when the record is updated, or when the execution context completes?