Skip to content

Entity Upserts and *ETag Support

This section describes two capabilities of IFS OData Services, especially applicable in system to system integration scenarios. Since both these capabilities skip the Optimistic Concurrency protection, it is not advisable to use them in interactive clients.

Upserting an Entity

Simply put, "Upserting" is the OData terminology for "Update or Create".

  • Upsert is simply a PATCH request but without the If-Match header.
  • If the entity does not exist in the database, then an insert operation is performed ignoring non-insertable attributes, otherwise an update operation is performed ignoring non-updateable attributes.
  • If the entity does not exist, OData Service tries to create the entity instead. Key values are taken from the URL, and the keys in the request body are ignored. If any one of the keys are not insertable then the operation will fail.

Refer OData Specification for Entity Upserts for more information. Also note that IFS OData Services does not provide any support for scenarios with If-None-Match Http Header, at the time of this writing.

Working with * ETag

IFS OData Services provides optimistic concurrency control through the use of If-Match Http Header for a number of applicable scenarios. While it provides a valuable protection against Loss Updates in interactive clients, it may be an unnecessary complication for system to system integration.

  • It is now possible to send the If-Match header with the value *, which is interpreted as to match against any value available in the particular resource.
  • The Entity bound operations - Update, Delete, Upload (Streaming), State Event Actions; which previously required an exact ETag match now works with *ETag.

Refer If-Match Header in OData for more information. Also note that IFS OData Services does not provide any support for scenarios with If-None-Match Http Header, at the time of this writing.