Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [concurrency]

The tag has no usage guidance.

1
vote
1answer
9 views

How can I tell what the 'Maximum number of batch apex jobs queued or active concurrently' limit is in our org?

Is there a way I can tell what the 'Maximum number of batch apex jobs queued or active concurrently' limit is in our org? Usually it is 5 (Refer to Page 3 in this document), but I believe our org has ...
3
votes
0answers
65 views

Synchronous concurrent transactions limit

I know that the following limits exist in salesforce: Number of synchronous concurrent transactions for long-running transactions that last longer than 5 seconds for each org : Limit 10 Concurrent ...
2
votes
2answers
142 views

future method concurrency

I have a button that calls a very complex feature that caused salesforce limits to be reached. I modified the method in asynchronous (@future) and added two states: "waiting" and "not processed". ...
0
votes
2answers
143 views

Property currently unsupported: 'concurrencyMode'

I was playing with workbench and tried to create job in "Rest Explorer". The Url I was using: /services/data/v41.0/jobs/ingest/ The Request Headers: Content-Type: application/json; charset=UTF-8 ...
1
vote
1answer
157 views

How to set the concurrencyMode using the new Bulk API 2.0

I've read the documentation regarding the new Bulk API 2.0 but I haven't found the way to send a request with the parameter concurrencyMode and set it to Serial instead of Parellel. Can you help me ? ...
1
vote
0answers
24 views

Unable to activate Process Builder on EmailMessage Obj - unable to obtain exclusive access

I am unable to activate a process builder and get the below error always. This is not a record that I am trying to update , it is a process builder. I checked whether there is any flow pending in ...
4
votes
1answer
245 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 ...
1
vote
1answer
203 views

UNABLE_TO_LOCK_ROW issue in concurrent API call

I am trying to make 100 concurrent API calls for creating an Object Example1. And this Example1 object is having Master-Detail Relationship with Parent Example1 Object. I am using same ...
3
votes
1answer
494 views

It is possible to set the concurrency mode for a Data Import Wizard job?

I'm running in to some problems that I believe may be related to parallel processing of an 'Add new record' job by the Data Import Wizard. Is it possible to somehow force the concurrency mode for the ...
3
votes
1answer
55 views

Salesforce transaction mutexes

This is more of a theory question. We have a use case where an object field is the sum of the records existing in the system + 1. This method is going to be accessed via force remoting. My worry is ...
7
votes
1answer
230 views

Is an AsyncApexJob record inserted immediately at the end of a transaction?

Is an AsyncApexJob record inserted immediately at the end of a transaction or is it possible that there is a delay between those two events? I couldn't find firm guarantee in the documentation on that....
5
votes
1answer
192 views

When using FOR UPDATE does Salesforce also lock the child records in a master-detail relationship?

For example, say I get a List of rows to delete using FOR UPDATE. These are all parent records in a master-detail relationship. Will the children be locked?
3
votes
2answers
404 views

Concurrency issue on Batches

I have two batch classes that run concurrently. Let's call them Job A and Job B. Job A inserts records in object A. And Job B in object B. Object B has a lookup to Object A. Because this lookup is ...
10
votes
3answers
88 views

Best practices for protecting your app/package from integrations with harmful side effects

We distribute our app in the form of a managed package. We have found that, in some cases, customers create their own integration (triggers, flows...) that have harmful effects on our application (...
0
votes
1answer
121 views

Email handler bulk/concurrency issue

I have an email handler class which takes failure notification emails from a payment gateway and updates the relevant records in Salesforce accordingly. The payment gateway sends these emails in an ...
1
vote
0answers
83 views

Get list of Concurrent processes in Execution

We are getting "Concurrent Requests Limit Exceeded." in our production org . Some transactions in our ORG require to much time as they involve callouts to external systems. Thus taking more than 5 ...
5
votes
2answers
894 views

How to Reproduce the Concurrent Requests Limit?

I'm trying to write code that will reproduce the Concurrent Requests limit (10 requests longer than 5 seconds, described here: https://developer.salesforce.com/blogs/engineering/2013/05/force-com-...
9
votes
1answer
1k views

How to avoid “Edit Session” conflicts in apex?

I am working on a project where sometimes the users gets error "The record were editing was modified by Other User during edit session" during SAVE. I did my research and found out that Salesforce ...
11
votes
1answer
1k views

Transaction isolation in Salesforce

As far as I understand Salesforce supports optimistic (by default) and pessimistic (using FOR UPDATE) locking for records. But what about transactions? If there direct analogy for typical SQL ...
11
votes
2answers
832 views

Enforcing mutual exclusion in Apex

I have an Apex class that calls out to a web service. The webservice doesn't allow multiple requests at the same time. I have an update trigger on Account that does the callout. So, if multiple users ...
8
votes
3answers
1k views

At what point in the transaction lifecycle is SystemModstamp set?

I'm writing an integration that requires polling Salesforce to pull down changed data. I'm worried about concurrent updates to the records that would cause me to 'miss' updates. Concrete example: ...
36
votes
1answer
589 views

Help me solve a concurrency mystery (platform bug? Expected behavior? Or am I missing something?)

To set up the problem, add a new currency data type custom field called Test_Counter__c to the Opportunity Object. Then create a test opportunity named TestOp. Then create the following class: ...
6
votes
2answers
238 views

Building VF Apps for Scale - Avoiding Locking Rows

Cut to the chase: What causes UNABLE_TO_LOCK_ROW errors and what are best practices for avoiding them? We built a great app that works solidly in development and testing. Today we launched to a ...
8
votes
3answers
6k views

How to atomically increment a custom field?

We are creating custom IDs for Accounts by incrementing an integer field in a custom class. The issue is that if two or more new Accounts are created in close sequence/simultaneously the following ...
15
votes
3answers
7k views

SOQL Record Locking (FOR UPDATE)

I am looking for some more definitive and in depth information about record locking in Salesforce. I will admit I am quite a novice when it comes to the topic of record locking, and am not sure it is ...