Handling concurrency with the Table service
The Windows Azure Table Service supports optimistic concurrency for entity updates. Each entity has an associated entity tag (ETag) that changes whenever the entity is updated. A storage operation that updates or deletes an entity will succeed only if it provides either the current ETag or the special ETag value of "*"
, which forces the change to be accepted by the Windows Azure Table service.
A context, either TableServiceContext
or DataServiceContext
, keeps a list of the entities it is currently tracking. This list includes objects added to the context with TableServiceContext.AddObject()
or attached through TableServiceContext.AttachTo()
. Unless configured otherwise, the entities returned by a query are also tracked. Any modification to a tracked entity is submitted as the appropriate storage operation to the Table service when DataServiceContext.SaveChanges()
or TableServiceContext.SaveChangesWithRetries()
is invoked.
The TableServiceContext...