locked
Missing etag RRS feed

  • Question

  • I have a problem with entities returned from the data service with no etag.  It's a problem when I try to send an update to one of the entities because I get an "expected etag" error message.

    My observations are:
    • a DataServiceRequest with expand clauses means no etag;
    • a DataServiceQuery with expands is fine, etag's returned for everything;
    • any linq query with .Expands("entity") returns no etag.

    Is there something I'm missing here?  Does anyone else have a similar problem?

    Saturday, January 10, 2009 9:11 AM

Answers

  • Hello,

    The missing etag problem is a known issue that will be fixed in the new release.

    Best regards,
    Monica
    • Marked as answer by Jif Tuesday, January 13, 2009 1:42 AM
    Monday, January 12, 2009 10:46 PM
    Moderator

All replies

  • Hello,

    The missing etag problem is a known issue that will be fixed in the new release.

    Best regards,
    Monica
    • Marked as answer by Jif Tuesday, January 13, 2009 1:42 AM
    Monday, January 12, 2009 10:46 PM
    Moderator
  • This is a significant pain in the bs

    Here's the scenario, I select a list of records using a DataServiceQuery, etags included no problem.  Can't use deep expands on the reference properties because of the MergeOption OverwriteChanges (more on that in a minute) throws an error with duplicate key inserts.

    So have to call LoadProperty on all the properties on an entity, can't call them in a batch because there is no option for this, just call them all async.  Can't call them independently in a batch because the reference properties would be loaded as null because of no expand option (same problem as above).

    End result is that I end up making a significant number of server calls to fetch just one entity and a few related properties/entities.

    The overwrite changes merge option is required because I make a change to an entity from the list, fire it at the server and then need to update my list (to get the new etag among other things).

    The compounding Data Services errors are making it very difficult to use, is there a new version expected soon?

    Thanks
    Tuesday, January 13, 2009 3:47 AM
  • Any chance you forgot to fix this in the new version?
    Monday, March 23, 2009 10:50 PM
  • >any linq query with .Expands("entity") returns no etag.

    I also encountered this trouble.
    But I found that adding "OrderBy" to linq query returns etag.

    For example:

    var query = Context.Products.Expand("Suppliers").Expand("Categories").OrderBy(x=>x.ProductID).Where(x => x.ProductID == productID);

    I try this way.
    But I don't know why this work well.

    Thursday, May 14, 2009 4:15 AM
  • Any chance you forgot to fix this in the new version?
    If you're referring to the recent CTP, there is still a known issue with ETags and $expand in that release. This issue will be fixed for the final release of ADO.NET Data Services v1.5. If you're experiencing a different issue, please provide more details.


    But I found that adding "OrderBy" to linq query returns etag.
    I'm not sure either why this brings back the ETags, but if it works consistently, then it seems like a reasonable workaround. I can't promise that it will always work, however. Happily, this would not break when the ETag issue is fixed in v1.5.
    Matt Meehan, ADO.NET Data Services (Astoria)
    Thursday, May 14, 2009 3:44 PM
    Moderator
  • Interesting, thanks for the tip.  I've simply stopped caring about concurrency for the time being, I'm hoping that the fix comes out before I need to make a release.

    Friday, May 15, 2009 1:40 AM