Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.7.x

Working with Cas

6 replies [Last post]
  • Login or register to post comments
Tue, 07/19/2011 - 04:34
Igal
Offline
Joined: 07/18/2011
Groups: None

hello,

I have a simple test app to test out membase and to see how to work with it

I want to keep a list of all my users' ids, so I've defined this in my page_load
casUsers = mc.Cas(Enyim.Caching.Memcached.StoreMode.Add, "AllUsers", string.Empty);
the way I understand it is that if the key doesn't exist , it will create it
and if it does it will give me it's latest Cas

and when I add a user through the gui:

casUsers = mc.Append("AllUsers", casUsers, new ArraySegment (Encoding.UTF8.GetBytes(sUsrIDToAppend)));

now.. this works , but it also works when instead of casUsers i pass the number 7 for example, or anything else..

what am I missing here?

thanks,
Igal

Top
  • Login or register to post comments
Tue, 07/19/2011 - 15:40
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None

Hi,

Thanks for reporting this issue, it was a bug in the client's Append/Prepend implementation.

It's fixed now, and the source is available at https://github.com/enyim/EnyimMemcached/commit/16d9e644e228026574c11239f...

I've built you a beta version of the library, so you do not need to mess with git.

- https://www.dropbox.com/s/y4ctu93cyms7gwn/Enyim.Caching.2.10-14-g16d9e64...
- https://www.dropbox.com/s/owjnvok4hc7h6n7/Membase.2.13-14-g16d9e64.zip

(official builds wil be available later this week or early next week, depending on the feedback of some other testers)

Let me know if you run into any more issues.

Top
  • Login or register to post comments
Wed, 07/20/2011 - 08:56
Igal
Offline
Joined: 07/18/2011
Groups: None

Hi Attila!

thanks for the quick response & fix !
I haven't had a chance to see if it works, because I'm having server issues

I have another question for you:
I want to implement a lock on one of my keys
according to this : http://www.couchbase.org/wiki/display/membase/Locking
I should use the 'add' & 'delete' commands to add a lock item
in your library add = Store with storemode.add?
and delete is Remove?

Top
  • Login or register to post comments
Wed, 07/20/2011 - 08:59
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None

Yes.

Top
  • Login or register to post comments
Thu, 07/21/2011 - 06:15
Igal
Offline
Joined: 07/18/2011
Groups: None

Hi, as to your solution, I've checked it

now if I pass a literal value such as 7, the cas operation fails as it should
but if i pass a non-initialized casObj.Cas (0), or just 0 to it , it works despite the fact that this
key/value has been used before and had a Cas different than 0

thanks :)
igal

Top
  • Login or register to post comments
Thu, 07/21/2011 - 06:20
Attila Kisko
Offline
Joined: 04/22/2010
Groups: None

0 means 'no cas value', meaning the server ignores the cas

try ulong.MaxValue

Top
  • Login or register to post comments
Thu, 07/21/2011 - 07:03
Igal
Offline
Joined: 07/18/2011
Groups: None

cool , thanks :)

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