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¶
OData uses the term "Upserting" to refer to the process of creating or updating a record.
- Upsert is simply a
PATCH
request but without theIf-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 a match against any value available for the specific resource.
- The Entity bound operations - such as Update, Delete, Upload (Streaming), and State Event Actions - that previously required an exact ETag match now accept *ETag as well.
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.