Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8584647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:49:19+00:00 2026-06-11T21:49:19+00:00

I am developing a node.js application on Windows Azure Websites (IISNode) and have installed

  • 0

I am developing a node.js application on Windows Azure Websites (IISNode) and have installed the Azure SDK module for node.js my question is how to use the etag or timestamp field in table storage.

Is it a matter of “me” doing something e.g:

if (entities[0].Timestamp == newEntity.Timestamp)
    // commit this update because we are dealing with the latest copy of this entity
else
    // oops! one of the entities is newer than the other, better not save it

Or do I need to listen for a error returned by the tableService.updateEntity( … for an error returned or something ?

Any help or advice appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:49:20+00:00Added an answer on June 11, 2026 at 9:49 pm

    As Neil mentioned good practice is to let table service handles the concurrency related stuff.

    When we fetch the entity from the table service using the client library, library will store the ETag associated with the entity (which present in the response from the service for the entity) in an EntityDescriptior instance (EntityDescriptor is an object maintained by the library for each entity instance in the context)

    When you submit a request to update an entity, sdk will prepare HTTP request with body as entity serialized to XML and ETag header of the request as the ETag value stored in the entity descriptor corresponding to the entity.

    When the table service receives this request for updating the entity instance, it checks whether the ETag in the request matches with the ETag currently associated with entity in the table storage (the ETag associated with the entity stored in the service changes if some other update happened before receiving your update request), if it does not matches service returns pre-condition failed/conflict error by setting Http status code in the response to 412 or 409.

    bool done = true;
    while (!done)
    {
        Stat statistics = _context.Execute<Stat>(new Uri("https://management.core.windows.net/<subscription-id>/services/storageservices/StatEntity?RowKey=..&PartitionKey=..").FirstOrDefault();
    
        try
        {
            // TODO: Update the entity, e.g. statistics.ReadCount++
            _context.UpdateObject(statistics);
            _context.SaveChanges();
            // success
            break;
        }
        catch (DataServiceRequestException exception)
        {
            var response = exception.Response.FirstOrDefault();
            if (response != null && (response.StatusCode == 412 || response.StatusCode == 409))
            {
                // Concurrency Exception - Entity Updated in-between
                // by another thread, Fetch the latest _stat entity and repeat operation
            }
            else
            {
                // log it and come out of while loop
                break;
            }
        }
        catch (Exception)
        {
            // log it and come out of while loop
            break;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a new web application for the Windows Azure cloud, but have
Developing for Android 2.3, I have a question regarding layouts. I use a vertival
I'm developing an application with node.js and socket.io. I have built a small-scale project
Hi We are developing application in node.js , socket.io , and redis. we have
I'm developing high-scalable application, so I decided to use Hazelcast for it. I have
I'm developing node.js application for Azure Cloud services. Everything works great, BUT sometimes my
I am developing Node.js application in Cloud9IDE and I problem using module (like node-expat
I have been developing in Node.js recently and have a good idea of what
I am developing a network protocol In which I have following requirement each node
In the application I am developing I have polygons as show in the picture

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.