Concurrency control
Stopping two people who opened the same record from silently overwriting each other — detecting that the version you read is no longer the version you are saving over.
Overview
@sap/cds Optimistic concurrency with ETags: an element annotated @odata.etag is the version, and an update whose If-Match no longer holds is rejected by the generic handlers.
com.sap.cds:cds-services-bom Detects concurrent modification of data across requests with ETags: an @odata.etag-annotated element or a @cds.java.version version element is checked against an If-Match header in OData, or against an explicit ETag predicate in custom code, on update and delete.
Not covered: At one record at a time, and at the protocol. It tells the second writer they lost; it does not merge, and it says nothing about a long-running edit, which is what draft handling exists for.
Locking inside a shared draft, which is the long-running edit the ETag does not reach: cap-collaborative-draftcap-collaborative-draftA cds-plugin that gives a CAP Node.js service the OData contract, tables and handlers Fiori elements needs for collaborative draft, so a second user joins an open draft instead of meeting HTTP 423.independent, cap takes a lock per OData property and answers HTTP 409 to a second participant patching the same field. See draft handlingDraft handlingLetting a user edit a record over several requests before it becomes real — saving unfinished changes, locking, and activating a completed draft.SAP and community, narrow by design for the draft itself.
Artifacts
Content
Details
Coverage
For your agent
- Ref
capability:concurrency-control- JSON
- /capabilities/concurrency-control.json
- MCP
- Connecting an agent