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

Continue-on-Error for Collection requests

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.01_CS01
    • Fix Version/s: V4.01_CS02
    • Component/s: Protocol
    • Labels:
      None
    • Environment:

      Proposed

    • Proposal:
      Hide

      Changes:
      1. Define Core.ExceptionType

        -optional info property of type MessageType

      2. (re) Define Core.ValueExceptionType : ExceptionType

        -optional value property of type string

      3. Define Core.ResourceException:ExceptionType to mark a resource or collection within a success payload as in error.
            -optional retryLink

      4. Define Core.ModificationException of type DataModificationException : ExceptionType
           -failedOperation (insert, update, upsert, delete, invoke, addlink, removelink)
           -optional responseCode (i.e., 424 for failed dependency)

      Clarifications:

      1. (non-key) Properties within tombstones in update payloads are effectively ignored

      Scenarios:
      1. Error retrieving a value within a structured resource (does not require continueonerror)
      a) Annotate property with the new Core.ValueException
       
      2. Error retrieving a resource within a collection (any collection, with continueonerror)
      a) Annotate resource within collection with Core.NestedItemException
       
      3. Error retrieving part of a collection (with continueonerror)
      a) Return a NextLink
       
      4. Error retrieving entire collection within a resource (with continueonerror)
      a) Annotate collection property with Core.NestedItemException

      5. Applying a delta update
      a) Return=representation response is a Delta response that is 1:1 with delta request
      b) Entities within the response have current persisted values
      c) Don’t support $select, $filter, $expand, $orderby, $search, $count, etc…
      d) If continue-on-error
      i) Failed deletes are returned as entities/entity references, annotated with DataModificationException (operation=delete or unlink)
      ii) Failed inserts are returned as tombstones with DataModificationException (operation=insert)
      iii) Failed updates may be annotated with DataModificationException (operation=update)
      iv) Failed addedlinks returned as deletedlink with DataModificationException (operation=link)
      v) Failed deletedlinks returned as addedlink with DataModificationException (operation=unlink)
      e) If the delta update contains a nested full representation, the response contains the full nested representation of the after-image.

      g) If the update of a nested resource fails, the update to the parent (and siblings) may fail
      i) Operation is the operation attempted at the resource that is annotated (i.e., update)
      ii) May return 424 Failed Dependency as status for related resources
      i) Unlike batch, if it is not annotated with failed, it is success
      h) If return=minimal + ContinueOnError, service MUST return at least the things in error
      i) perhaps as a flattened delta payload
       
      6. Applying a deep update/insert
      a) Don't support continue-on-error for deep inserts/updates
      b) Deep updates can support delta collections and inline full representations. Deep inserts are not extended to support updating - the client can do a delta update against the collection with the single entity to be inserted, including nested information to be updated.

      c) Response is the same shape as the deep update/insert in the request
      d) Entities within the response have current persisted values
       
      7. Applying a set-based update
      a) Response (if specified by return=representation) is the delta response showing current values (after-image) of the set of things identified by the input collection (i.e., after any filter segment). Note that specifying return=representation may remove any implementation optimizations around doing the set operation.
      b) Note: may be deep update (including nested collection/delta collection, in which case above rules apply)
      c) Don’t specify support for query options
      d) If continue-on-error
      i) Failed updates may be annotated with DataModificationException (operation=update)
      ii) If return=minimal + continue on error, MUST return at least the things in error (perhaps flattened)
       
      8. Applying a set-based delete
      a) Response (if specified by return=representation) is the delta response showing tombstones for the set of things identified by the input collection (i.e., after any filter segment). Note that specifying return=representation may remove any implementation optimizations around doing the set operation.
      b) Don't specify support for query options
      c) If continue-on-error
      i) Failed deletes returned as entity/entity reference with DataModificationException (operation=delete)
      ii) If return=minimal + continue on error, MUST return at least failures

      9. Applying a set-based action invocation
      a) Clarify that (if specified by return=representation) the result of a set-based action invocation is a collection of the individual action responses as if they had been invoked separately (including any value wrapper for collections or primitives).
      c) Support for query options is not specified, but apply to each individual action response
      d) If continue-on-error
      i) Response objects returned from failed invocations may be annotated with DataModificationException (operation=invoke)
      ii) If return=minimal + continue on error, MUST return at least the things in error

      Show
      Changes: 1. Define Core.ExceptionType   -optional info property of type MessageType 2. (re) Define Core.ValueExceptionType : ExceptionType   -optional value property of type string 3. Define Core.ResourceException:ExceptionType to mark a resource or collection within a success payload as in error.       -optional retryLink 4. Define Core.ModificationException of type DataModificationException : ExceptionType      -failedOperation (insert, update, upsert, delete, invoke, addlink, removelink)      -optional responseCode (i.e., 424 for failed dependency) Clarifications: 1. (non-key) Properties within tombstones in update payloads are effectively ignored Scenarios: 1. Error retrieving a value within a structured resource (does not require continueonerror) a) Annotate property with the new Core.ValueException   2. Error retrieving a resource within a collection (any collection, with continueonerror) a) Annotate resource within collection with Core.NestedItemException   3. Error retrieving part of a collection (with continueonerror) a) Return a NextLink   4. Error retrieving entire collection within a resource (with continueonerror) a) Annotate collection property with Core.NestedItemException 5. Applying a delta update a) Return=representation response is a Delta response that is 1:1 with delta request b) Entities within the response have current persisted values c) Don’t support $select, $filter, $expand, $orderby, $search, $count, etc… d) If continue-on-error i) Failed deletes are returned as entities/entity references, annotated with DataModificationException (operation=delete or unlink) ii) Failed inserts are returned as tombstones with DataModificationException (operation=insert) iii) Failed updates may be annotated with DataModificationException (operation=update) iv) Failed addedlinks returned as deletedlink with DataModificationException (operation=link) v) Failed deletedlinks returned as addedlink with DataModificationException (operation=unlink) e) If the delta update contains a nested full representation, the response contains the full nested representation of the after-image. g) If the update of a nested resource fails, the update to the parent (and siblings) may fail i) Operation is the operation attempted at the resource that is annotated (i.e., update) ii) May return 424 Failed Dependency as status for related resources i) Unlike batch, if it is not annotated with failed, it is success h) If return=minimal + ContinueOnError, service MUST return at least the things in error i) perhaps as a flattened delta payload   6. Applying a deep update/insert a) Don't support continue-on-error for deep inserts/updates b) Deep updates can support delta collections and inline full representations. Deep inserts are not extended to support updating - the client can do a delta update against the collection with the single entity to be inserted, including nested information to be updated. c) Response is the same shape as the deep update/insert in the request d) Entities within the response have current persisted values   7. Applying a set-based update a) Response (if specified by return=representation) is the delta response showing current values (after-image) of the set of things identified by the input collection (i.e., after any filter segment). Note that specifying return=representation may remove any implementation optimizations around doing the set operation. b) Note: may be deep update (including nested collection/delta collection, in which case above rules apply) c) Don’t specify support for query options d) If continue-on-error i) Failed updates may be annotated with DataModificationException (operation=update) ii) If return=minimal + continue on error, MUST return at least the things in error (perhaps flattened)   8. Applying a set-based delete a) Response (if specified by return=representation) is the delta response showing tombstones for the set of things identified by the input collection (i.e., after any filter segment). Note that specifying return=representation may remove any implementation optimizations around doing the set operation. b) Don't specify support for query options c) If continue-on-error i) Failed deletes returned as entity/entity reference with DataModificationException (operation=delete) ii) If return=minimal + continue on error, MUST return at least failures 9. Applying a set-based action invocation a) Clarify that (if specified by return=representation) the result of a set-based action invocation is a collection of the individual action responses as if they had been invoked separately (including any value wrapper for collections or primitives). c) Support for query options is not specified, but apply to each individual action response d) If continue-on-error i) Response objects returned from failed invocations may be annotated with DataModificationException (operation=invoke) ii) If return=minimal + continue on error, MUST return at least the things in error
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-vocabularies/pull/55/files https://www.oasis-open.org/committees/download.php/65504/odata-v4.01-wd06-part1-protocol-2019-06-20.docx  

      Description

      In a GET against a collection of entities, it is possible that an entity returns an error, for example if a connection to the provider of the entity is lost.

      The proposal is to allow a Continue-On-Error preference or a $Continue-On-Error query option for a GET against a collection.

      In the event of an error returned by an entity being retrieved, the effect of Continue-On-Error,  would be to stop the current page, returning both the entities up to the error and an Error result for the element that returned the error and, if there are additional elements following, a nextLink for use in retrieving the remaining entities in the collection.

      Note for discussion, the first result could be split, first returning entities up to but not including the failed entity, with a nextLink to retrieve the error result for the failing entity, And finally more entities, if the last returned a nextLink. 

       

       

        Attachments

          Activity

            People

            • Assignee:
              mikep Michael Pizzo (Inactive)
              Reporter:
              george.ericson George Ericson
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: