Home > Ajax, jQuery, Programming, Web Service > ETag value in header different from object ETag

ETag value in header different from object ETag

This is more a note to self which will hopefully help someone.

The last couple of weeks I have been working on a web application that uses WCF Data Services (oData) and jQuery.  I started receiving the following error: "The etag value in the request header does not match with the current etag value of the object.".  After hours of struggling I found out that it was the oninsert trigger in my database causing the problem.  It seems that when you insert the data the trigger changes that and then it is different from what you inserted and it then throws an error instead of returning the record you have just inserted.

Advertisements
  1. sris
    25 January 2012 at 05:32

    Other than removing the trigger, how to solve this?

  2. Vinicius
    17 August 2012 at 20:47

    I have the same problem but mine happens from time to time. How do to solve this? help

  3. Pieter
    20 August 2012 at 11:15

    Vinicius, check the data posted when this happens. It sounds to me like a trigger that only triggers on a certain condition. As far as I remember that problem is that the object returned is not the original one inserted; something is changing the object between posting it to the server and WCF returning it back to the browser.

    Sorry but I cannot be of any more help than this, unless it’s an opensource project which I can have a look at and potentially spot the problem.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: