title: Azure Storage Tables - Update Condition Not Satisfied
body: <p>I'm getting a random Exception when I try to update an entity on a storage table. The exception I get is</p>
  
  <pre><code>System.Data.Services.Client.DataServiceRequestException: An error occurred while processing this request. ---&gt; System.Data.Services.Client.DataServiceClientException: {"odata.error":{"code":"UpdateConditionNotSatisfied","message":{"lang":"en-US","value":"The update condition specified in the request was not satisfied.\nRequestId:2a205f10-0002-013b-028d-0bbec8000000\nTime:2015-10-20T23:17:16.5436755Z"}}} ---
  </code></pre>
  
  <p>I know that this might be a concurrency issue, but the thing is that there's no other process accessing that entity.</p>
  
  <p>From time to time I get dozens of these exceptions, I restart the server and it starts working fine again.</p>
  
  <pre><code>public static class StorageHelper
      {
          static TableServiceContext tableContext;
  
          static CloudStorageAccount storageAccount;
  
          static CloudTableClient CloudClient;
  
  
  
          static StorageHelper()
          {
  
                  storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
                  CloudClient = storageAccount.CreateCloudTableClient();
                  tableContext = CloudClient.GetTableServiceContext();
                  tableContext.IgnoreResourceNotFoundException = true;
              }
  
  
  
  public static void Save(int myId,string newProperty,string myPartitionKey,string myRowKey){
       var entity = (from j in tableContext.CreateQuery&lt;MyEntity&gt;("MyTable")
                            where j.PartitionKey == myId
                            select j).FirstOrDefault();
  
  
              if (entity != null)
              {
                  entity.MyProperty= myProperty;
                  tableContext.UpdateObject(entity);
                  tableContext.SaveChanges();
  
  
              }
              else
              {
                  entity = new MyEntity();
                  entity.PartitionKey =MyPartitionKey;
                  entity.RowKey =MyRowKey;
                  entity.MyProperty= myProperty;
                  tableContext.AddObject("MyTable", entity);
                  tableContext.SaveChanges();
              }
  }
  </code></pre>