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

spymemcached 2.7 "touch"

5 replies [Last post]
  • Login or register to post comments
Mon, 01/09/2012 - 15:26
yamahabob
Offline
Joined: 01/09/2012
Groups: None

key="spoon"
value="Hello World!"

This is the key value stored on my cluster, and I'm using spymemcached 2.7.3. I want to update the amount of time the key is good for from 10seconds to 100.

If the key exists, "Hello World!" is printed, and I proceed to run touch as follows:
client.touch("spoon",100);

When executing the code, here's what happens:

Hello World!
Exception in thread "main" java.lang.UnsupportedOperationException: Touch is not supported for ASCII protocol
at net.spy.memcached.protocol.ascii.AsciiOperationFactory.touch(AsciiOperationFactory.java:87)
at net.spy.memcached.MemcachedClient.touch(MemcachedClient.java:551)
at net.spy.memcached.MemcachedClient.touch(MemcachedClient.java:531)
at Main.main(Main.java:21)

Top
  • Login or register to post comments
Mon, 01/09/2012 - 17:18
ingenthr
Offline
Joined: 03/16/2010
Groups:

The touch command is part of Couchbase Server 2.0, it is not available in Membase 1.7.

Top
  • Login or register to post comments
Wed, 01/11/2012 - 11:20
mikew
Offline
Joined: 03/14/2011
Groups:

All, I just looked in the Membase source and touch is supported in 1.7.1. I also tested this against Membase 1.7.1 and it worked fine. The reason for the error here is that touch is not supported in the ASCII protocol as the error says. If you change your client to use the binary protocol this operation will work correctly.

Top
  • Login or register to post comments
Wed, 01/11/2012 - 15:08
ingenthr
Offline
Joined: 03/16/2010
Groups:

Oh, you're right Mike. Sorry, I remembered that incorrectly.

Top
  • Login or register to post comments
Thu, 01/12/2012 - 11:19
yamahabob
Offline
Joined: 01/09/2012
Groups: None

Being new to Membase, what will changing from ASCII to Binary effect? I haven't done much with Membase yet, only testing the API calls and what not so making the switch will not have any immediate changes, but I imagine something will be different down the road.

Thanks again

Top
  • Login or register to post comments
Thu, 01/12/2012 - 11:59
mikew
Offline
Joined: 03/14/2011
Groups:

You shouldn't notice any changes in your application code between the ASCII and binary protocol. In fact binary protocol should be preferred over ASCII.

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