Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

libcouchbase ADD vs SET

1 reply [Last post]
  • Login or register to post comments
Tue, 07/03/2012 - 09:24
yarwoob
Offline
Joined: 07/03/2012
Groups: None

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.

Top
  • Login or register to post comments
Tue, 07/03/2012 - 21:55
sjpark9
Offline
Joined: 03/01/2012
Groups: None

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

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker