Upsert does not work with OptimisticConcurrency

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

      [Proposed][Applied]

    • 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.

      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.

            Assignee:
            handl
            Reporter:
            handl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: