Symptom
When opening an opportunity, the error "Locking object not possible; object locked by user" appears; API updates to the opportunity may fail with the same error.
Environment
Product: SAP Cloud for Customer core application
Reproducing the Issue
- Go to the Sales work center.
- Open Opportunities.
- Open an opportunity.
- Observe the error: "Locking object not possible; object locked by user."
Cause
A deadlock caused by custom PDI logic locks the Opportunity business object with the logged-in user, preventing further processing and leading to the lock error.
Resolution
- Review custom PDI implementations related to Opportunity, including event handlers and actions invoked by embedded components or integrations.
- Remove or minimize explicit object locks and avoid holding locks across long-running operations or external calls.
- Ensure any logging or auxiliary updates do not occur within the same transaction that retains the Opportunity lock; decouple such operations if needed.
- Optimize the code to release the Opportunity lock promptly after necessary updates are committed.
- Test opening and updating the Opportunity (including via API/integration) to confirm the lock error no longer occurs.
- Temporary workaround: clearing related custom logs that keep the lock may unblock processing, but this is not a permanent fix and should be used only for immediate relief while implementing the code changes.
See Also
Keywords
locking object not possible, object locked by user, opportunity, sales cloud, c4c, lock error, api update fails, embedded component, pdi, custom code, deadlock, bo lock, concurrent edit, integration, cpi , KBA , LOD-CRM-LM , Lead Management , Problem
SAP Knowledge Base Article - Public