The remote server returned an error: (412) Precondition Failed.
Hi, 0.6 it seems to work in most cases, but for some rows I receive this error when doing an update: "The remote server returned an error: (412) Precondition Failed.". No clue yet why I receive this error for some rows and not for others :-/
System.Net.WebException was unhandled HResult=-2146233079 Message=The remote server returned an error: (412) Precondition Failed. Source=System StackTrace: at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request) at System.Net.WebClient.UploadString(Uri address, String method, String data) at GDataDB.Impl.Row`1.Update() in c:\prg\GDataDB\GDataDB\GDataDB\Impl\Row.cs:line 24
Can you post a failing test?
I found out in the meantime what caused the problem. These are all rows that are updated twice without refreshing the GDataDB.ITable in the meantime. So kind of sounds logic to me that it cannot update the row anymore as it does not contain the original values anymore?
You mean you have multiple concurrent writers? Or does even a simple row.Update(); row.Update(); fail?
Not Multiple concurrent writers, but 2 times an update. It can be reproduced in your sample code. In Program.cs, replace
r.Element.Conteudo = "nothing at all";
Console.WriteLine("updating row");
r.Update();
with
r.Element.Conteudo = "nothing at all";
Console.WriteLine("updating row");
r.Update();
r.Element.Conteudo = "nothing at all again";
Console.WriteLine("updating row again");
r.Update();
(where the 5th and 6th line are not even needed to reproduce it)
My guess is we need to change the row's etag with the response of each update. Could you check that?