OData and optimistic concurrency


As a short follow-up on HTTP and optimistic concurrency, I wanted to touch on how OData deals with concurrency.

The nice thing is that there is very little for me to write about. By and large, the OData protocol "piggy-backs" on the HTTP protocol and uses the same mechanism of entity tags and headers. All good.

The only difference is that OData also specified the individual ETags for each entity when you are asking for a feed of many entities at once. This allows you to not have to re-request each entity separately just to get the ETag in the cases when you want to update one of them. The Concurrency control and ETags section discusses this, and for example you can see how this comes in an ATOM entry in an m:etag attribute.

<feed namespace declarations>

<entry m:etag=’W/"123"’>…</entry>
<entry m:etag=’W/"456"’>…</entry>
</feed>

This just makes things more efficient and eliminates round-trips, while still preserving all the HTTP goodness for general HTTP processors and caches.

Enjoy!

Comments (0)

Skip to main content