libcouchbase ADD vs SET
Tue, 07/03/2012 - 09:24
Using the example "Hello C Couchbase" C program found here:
http://www.couchbase.com/docs/couchbase-sdk-c-1.0/hello_couchbase.html
If I change the type of store action from LIBCOUCHBASE_SET to LIBCOUCHBASE_ADD and repeatedly run the program it always outputs the message "Successfully set hello." even though my understanding was that the add action should return an error if they key already exists.
Am I misinterpreting something or is their some other change that is required in the libcouchbase_store method?
We are using for testing libcouchbase 1.0.4 and the 1.8 enterprise server.
I've tried the same thing and got same result as yarwoob
I've added storage_callback to check the callback error.
from the storage callback function, I've checked
Callback Error : 12 ( printf integer type of libcouchbase_error_t )
error : Key exists (with a different CAS value) ( called libcouchbase_strerror function)
It seems the return value of oprc is checking error of before calling membase transaction.
Hope it helps :D