0

Please correct me if I am wrong. Somewhere I read an article that each account has their own separate transaction. Also, I don't think that customers will be using Developer Console to update or trigger some bulk records since they only has access to Salesforce UI. So, if an account is restricted to use Developer Console, does that mean each event in sf ui will be in single transaction (assuming that there is no code that updates multiple records when a certain record is inserted or updated)?

Example.. I am a customer.. I have updated the record in salesforce UI.. so it's not possible for me to trigger a bulk transaction?

Then how about if the same account is login to multiple computers and the user updated the same record at the same time.. is the update of each record in the same transaction or separate governor limits?

2 Answers 2

1

I think you have gotten confused by what you have read.

The standard Salesforce UI allows the user to perform a sequence of actions (typically create, edit, delete against individual records), and these are all separate transactions against the org and its data. Note, however, that Salesforce List Views allow for mass updates and the updates are done in a single transaction.

Further, a given event against some data may invoke triggers, flows or other automation, and these may in turn cause other events to happen depending on what they have been authored to do.

In terms of your concurrent updates by the same user through different browser tabs; each of the updates is an entirely separate transaction against the org.

A "transaction" is an interaction with the org, whether that is loading a record to display in a Lightning Record Page, creating a record via a New Record page, calling a REST API to query, create, update or delete some data or any other type of interaction. These are typically quite short-lived and certainly are not shared by multiple separate browser tabs on different computers.

Each transaction typically has a "contextual user" - the user who performed some action to initiate the transaction. It's this "contextual user" that identifies the permissions and sharing access to be applied, and that will be captured as the creator or modifier of those record(s) they manipulate.

Governor limits are set at the start of each individual transaction.

1

So, if an account is restricted to use Developer Console, does that mean each event in sf ui will be in single transaction (assuming that there is no code that updates multiple records when a certain record is inserted or updated)?

  1. Restricting an account to use the developer console is not possible.
  2. Each DML conducted through the UI will initiate a transaction that may or may not affect multiple records. If you have an Apex trigger that deletes a related object when you do something to another object, then your transaction starts with a DML on a single object, but will in total contain multiple DMLs. That's where you start to think about the governor limits (how many queries and DMLs are allowed per transaction).

I am a customer.. I have updated the record in salesforce UI.. so it's not possible for me to trigger a bulk transaction?

That depends on what your record update does, and which automation you have in place. If you have no automation in place, then in general every update conducted through the UI will be a single transaction that processes the update for a single record. Like in my example above, if you have an automation that does update related records then your transaction will start with that update DML but will process other things too. And everything will happen in the same transaction (unless you have something running asynchronously).

It is quite common to have a requirement like "update this record, and then process all other records asynchronously". In this kind of scenario, your main transaction does the update and, at the end, fires an asynchronous process to do the bulk update (depending on the number of records, you won't be able to do the update in the same transaction - for example if you want to update millions of records).

Then how about if the same account is login to multiple computers and the user updated the same record at the same time.. is the update of each record in the same transaction or separate governor limits?

First of all: sharing an account is a violation of the MSA with Salesforce. Secondly: in this scenario whoever manages to get the request first on the server will likely lock the record for updates from others. Others' requests will still try to be processed but will have to wait until the previous one finishes, since they are all trying to modify the same row in the database. What might also happen in this scenario is that the transactions take longer to process and then the other transactions at the end of the queue will fail (because of the 10 seconds rule in the governor limits).

To better illustrate, imagine you have three users updating the same record. Because of the amount of automation in the org, the transaction takes four seconds to complete in total. So all transactions seemingly start at the same time, but just one of them manages to get a lock on the record. The other two are in the queue to be processed next. All transactions' time start at almost the same time, so the first one takes four seconds, but the second transaction really manages to continue only after the first is completed, so the second transaction takes eight seconds total. The same happens for the third transaction, but because its total execution time would be twelve seconds, which is longer than the ten second-limit, it fails.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .