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.
Other than removing the trigger, how to solve this?
I do not know how to resolve it without removing the trigger.
If you cannot get it resolved then please let me know and I will try and recreate it. It should not be to hard reading this: http://www.odata.org/developers/protocols/operations#ConcurrencycontrolandETags
If however you did manage to get it solved then please post the solution, or a link to the solution here please.
I have the same problem but mine happens from time to time. How do to solve this? help
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.