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

Alternative Locking and unlocking

1 reply [Last post]
  • Login or register to post comments
Fri, 05/04/2012 - 02:56
sjpark9
Offline
Joined: 03/01/2012
Groups: None

I've read the document and found

alternative locking (other than using CAS)

It was using "ADD" API for the same key in order to act like "locking"

I was wondering if you have any suggestion for the "unlocking"

I am apparently using "libcouchbase" of c++ and "spymemcached" of JAVA.

for libcouchbase, I am calling libcouchbase_remove to delete the selected key.

since the document lacks a lot of information, I was wondering what does the remove aPI return for the errors.

I expect "no key", "network interruption" etc.

I would like to know how we should take care of this remove API in order to prevent any collisions?

Our logic for the project:

1. Lock ( Add)
2. Processes
3. Unlock ( Delete)

and three process are watching the same lock.

What I am really wondering about is returning Errorcode for each APIs. Since it is really important to know in order to handle the process

Top
  • Login or register to post comments
Wed, 05/23/2012 - 22:08
mikew
Offline
Joined: 03/14/2011
Groups:

1. Lock (Add)
Will return EXISTS(0x02) if the lock is taken and SUCCESS(0x00) if the process has obtained the lock.
2. Processes
3. Unlock (Delete)
Will return SUCCESS(0x00) if the lock was unlocked and NOT_FOUND(0x01) if someone else removed the lock which would be an error in your client code.

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