Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-716

Upsert does not work with OptimisticConcurrency

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_OS
    • Fix Version/s: V4.0_ERRATA01
    • Component/s: Protocol
    • Labels:
      None
    • Environment:

      [Proposed][Applied]

    • Proposal:
      Hide

      Call out that If-Match only makes sense for operations on existing entities (update, delete). Doing a PUT/PATCH with no If-Match fails if the entity requires an ETag and already exists. Doing a PUT/PATCH with no If-Match can still be processed as an insert if the entity does not exist.

      Show
      Call out that If-Match only makes sense for operations on existing entities (update, delete). Doing a PUT/PATCH with no If-Match fails if the entity requires an ETag and already exists. Doing a PUT/PATCH with no If-Match can still be processed as an insert if the entity does not exist.

      Description

      Upsert allows constructing a resource path and providing a desired after-image. If the request is executed successfully, the identified entity will exist and look somewhat similar to the desired after-image.

      Unfortunately this does not combine with optimistic concurrency.

      If an operation on an entity requires an ETag, then services MUST refuse requests without an If-Match header.

      If the client doesn't know (or care) whether the entity already exists, it cannot produce a valid If-Match header, because even the wildcard * does not work: HTTP defines that if the field-value is "*", the condition is false if the origin server does not have a current representation for the target resource, i.e. it is false if the entity does not yet exist.

      I don't see a way to make upsert work in combination with ETags.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: