Group Membership Locking
Typically, these locks are held only very briefly, so most customers never see a lock conflict error. In some scenarios—such as a change in role triggering a sharing rule recalculation—locks can be held for a longer time, and conflicts can occur.
Customers who experience these locking errors are typically executing large-scale data loads or integrations with other internal systems that are making changes to role and group structure, user assignments to roles and groups, or both. When these processes are running—and a Salesforce admin tries to change a user’s role, or the customer tries to provision a new external user—one of these simultaneous operations might be unable to secure the lock it requires. The most likely time for this failure to occur is during periodic organizational realignment events, such as end-of-year or end-of-quarter processing, where many account assignments and user roles are changing.
Customers can lessen the chance of locking errors by:
- Scheduling separate group maintenance processes carefully so they don’t overlap
- Implementing retry logic in integrations and other automated group maintenance processes to recover from a failure to acquire a lock
- Trying serial processing if using parallel processing leads to locking errors
By default, granular locking is enabled, which allows some group maintenance operations to proceed simultaneously if there’s no hierarchical or other relationship between the roles or groups involved in the updates. Admins can adjust their maintenance processes and integration code to take advantage of this limited concurrency to process large-scale updates faster, all while still avoiding locking errors.
The key advantages of granular locking are that:
- Groups that are in separate hierarchies can be manipulated concurrently.
- Public groups and roles that don't include territories aren't blocked by territory operations.
- Users can be added concurrently to territories and public groups.
- User provisioning can occur in parallel.
- External user creation requires locks only if new external roles are being created.
- Provisioning new external users in existing accounts occurs concurrently.
- A single-long running process, such as a role delete, blocks only a small subset of operations.
This table lists all the operations that can occur in parallel. If a specific grouping of operations isn’t listed in the table, then concurrent processing isn’t supported and group membership locking can occur. Note that certain operations, such as reparenting (moving roles within the role hierarchy), still block almost all other group updates.
1 The user must not own any customer or partner accounts.
2 Provisioning standard user or external user in an existing role
3 Provisioning any standard or external user, including the first customer or partner user under an account