none
Android :HealthVault Duplicate insertion on Network Failure RRS feed

  • Question

  • Hi,

    I am trying to insert multiple blood pressure data and weight data to HealthVault. I have 10 data, in loop I am inserting each data. If network is busy or fail after inserting three set of data then remaining 7 set of data is lost.  Then i try to insert the data again the first three set of data will be there in HealthVault due to the network failure the duplication of first three data occurs. 



    rohith

    Friday, January 17, 2014 4:33 PM

Answers

  • Hi,

    There are a couple of ways to handle the scenario you are describing. 

    You can send all 10 items in a single PutThings request.  HealthVault will ensure all of them are added to the record or none of them are.  However, due to network failures, you still may be uncertain if the 10 items were added or not!

    Use client-id to resolve "in-doubt" transactions.  You can assign a "client-id" to each Thing you push.  The id is assigned by you and persisted in HealthVault.  If you have not obtained a response from your PutThings call, you can then query for that specific client-id to determine if the thing(s) has been successfully pushed to HealthVault. 

    PutThings call: 

    <thing>
      <type-id>52bf9104-2c5e-4f1f-a66d-552ebcc53df7</type-id>
      <data-xml>
        <allergy>
           ...snip...
        </allergy>
        <common>
          <client-thing-id>123</client-thing-id>
        </common>
      </data-xml>
    </thing>
    

    Query:

    <info>
      <group max="30">
        <client-thing-id>123</client-thing-id>
        <filter>
          <type-id>52bf9104-2c5e-4f1f-a66d-552ebcc53df7</type-id>  
        </filter>
        <format>
          <section>core</section>
          <xml></xml>
        </format>
      </group>
    </info>
    

    Friday, January 17, 2014 11:07 PM

All replies

  • Hi,

    There are a couple of ways to handle the scenario you are describing. 

    You can send all 10 items in a single PutThings request.  HealthVault will ensure all of them are added to the record or none of them are.  However, due to network failures, you still may be uncertain if the 10 items were added or not!

    Use client-id to resolve "in-doubt" transactions.  You can assign a "client-id" to each Thing you push.  The id is assigned by you and persisted in HealthVault.  If you have not obtained a response from your PutThings call, you can then query for that specific client-id to determine if the thing(s) has been successfully pushed to HealthVault. 

    PutThings call: 

    <thing>
      <type-id>52bf9104-2c5e-4f1f-a66d-552ebcc53df7</type-id>
      <data-xml>
        <allergy>
           ...snip...
        </allergy>
        <common>
          <client-thing-id>123</client-thing-id>
        </common>
      </data-xml>
    </thing>
    

    Query:

    <info>
      <group max="30">
        <client-thing-id>123</client-thing-id>
        <filter>
          <type-id>52bf9104-2c5e-4f1f-a66d-552ebcc53df7</type-id>  
        </filter>
        <format>
          <section>core</section>
          <xml></xml>
        </format>
      </group>
    </info>
    

    Friday, January 17, 2014 11:07 PM
  • Hi robmay,

    Thank you for the response.

    I have to maintain blood pressure and weight at the same item. Is there any way to add weight and blood pressure together?

    I have one more doubt:

    1: If we send 10 items in a single PutThing request and request for GetThings using above query as info, then I will get response for the 10 items if all the datas successfully pushed to HealthVault or just the latest item?



    rohith

    Monday, January 20, 2014 10:41 AM
  • Hi Rohith, Would you be able to do this by assigning a client ID to each item (BP and weight) and querying these client IDs at the end of the transaction? I am not a programming expert but I think that is what robmay is referring to.
    Wednesday, January 22, 2014 2:55 AM