spring-projects/spring-data-rest — pull request #148 by Altaflux (2014-09-10 21:33:29+00:00)
Title: DATAREST-160 Etag/If-Match based concurrency handling based on @Version Locking

Brings Etag/If-Match based concurrency handling.

This allows safely editing the same entities concurrently and will throw an HTTP Conflict response when modification have been made. This is designed for requests: PUT,PATCH,DELETE.

Every time a GET is performed on an entity that contains a version property it will add to the response an Etag header with the value of the version property.

If during the patch/put/delete of the entity an If-Match header is included it will be validated against the current version of an entity and allowed to proceed if both are still equal, else Conflict 409 response will be sent back.

If the modifying request's don't include an If-Match header operations will be allowed bypassing this validation for the sake of compatibility.

When {{ReturnBodyOnUpdate}} and/or {{ReturnBodyOnCreate}} are active the Etag will be sen't too.