I tried the following sequence on OSX, running Couchbase Enterprise server version 2.1.1-764-rel and Java client 1.1.8 (and reverified on 1.1.9).
java -version gives me:
java version "1.7.0_13"
Java™ SE Runtime Environment (build 1.7.0_13-b20)
Java HotSpot™ 64-Bit Server VM (build 23.7-b01, mixed mode)
Run the following program:
public class Main { public static void main(String[] args) throws Exception { CouchbaseClient client = new CouchbaseClient( Arrays.asList(new URI("http://localhost:8091/pools")), "bucket", ""); boolean setSuccess = client.set("foo", "dummy").get();
CASValue<Object> cas = client.getAndLock("foo", 30);
boolean deleteSuccess = client.delete("foo", cas.getCas()).get();
Object value = client.get("foo");
client.shutdown();
}
}
I am surprised by the values of the variables deleteSuccess and value. I see “false” and “dummy” but expected “true” and null.
Is this a bug in the Java client (or Couchbase server?) or am I doing something wrong?