Stream: implementers
Topic: How to avoid overwriting newer versions of a resource
Dan Orr (Jul 19 2017 at 22:30):
We have a scenario whereby two clients are performing conditional updates to a resource and we want to ensure that a newer version of the resource, is not overwritten by an older version. Essentially, we want to address the "lost updates problem".
How can this be achieved without requiring the client to first retrieve the resource?
We have a basic requirement of having the client supply a date of last edit/update but running into where to put it within the resource?
Is there a better way?
Lloyd McKenzie (Jul 20 2017 at 01:51):
When you create or update a resource, the server can send back an etag in the HTTP header. The server can require submission of the etag on subsequent updates. If the etag isn't the same as the current version, the update will be rejected. See here: http://hl7.org/fhir/http.html#concurrency
Dan Orr (Jul 20 2017 at 02:28):
Thanks @Lloyd McKenzie , that's the clarification we were after. We're going to push the problem of handling different versions of resources created by the client, back to the client.
Last updated: Apr 12 2022 at 19:14 UTC