Expected behaviour of ExecuteGet?
Reposting here from Couchbase 1.8 forum:
Using the .NET v1.1.6 client against Couchbase 1.8.1, I'm getting surprising results from the new ExecuteGet() method
var key = Guid.NewGuid().ToString(); var result = client.ExecuteGet(key); // Doesn't exists Console.WriteLine(result.Success); // false Console.WriteLine(result.Message); // Unable to locate node Console.WriteLine(result.Value); // null client.Store(StoreMode.Set, key, "blah"); // Adding it result = client.ExecuteGet(key); // Does exist Console.WriteLine(result.Success); // true Console.WriteLine(result.Message); // null Console.WriteLine(result.Value); // blah
Is this behaviour by design? It seems that it isn't possible to distinguish between a network failure and a key that doesn't currently exist. In the case of a non-existent key, my expectation would be that Success == true but Value == null.
UPDATE: I checked out the master branch of couchbase-dot-net client repo and I can see that the test
is passing and correctly setting a status code of 1 (StatusCodeEnums.NotFound). This makes a lot more sense. The problem is I don't get this same behaviour for my client (v1.1.6). I also can't seem to be able to get the release11 branch of couchbase-dot-net to compile due to differences in the Enyim client.