Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Memcached Server 1.0.3

membase smart client intended usage

1 reply [Last post]
  • Login or register to post comments
Fri, 10/15/2010 - 15:19
amy
Offline
Joined: 10/15/2010
Groups: None

I'm using the membase 1.0.3 java smart client, talking to a specific bucket. I had some general questions about how to use the client.

1. Is it ok to call ClientManager.getClient() every time I want to access the cache, or is there overhead in calling getClient() such that I need to cache the MemcachedClient for a while?

2. Do I have to call MemcachedClient.shutdown() after each call to ClientManager.getClient(), or is it intended that the ClientManager will take care of this behind the scenes?

3. Will the ClientManager do the right thing to reconnect to a bucket if I delete that bucket and recreate it?

Top
Mon, 10/18/2010 - 22:38
ingenthr
Offline
Joined: 03/16/2010
Groups:

With #1, it's actually the intended usage that you call getClient regularly.  You should only keep a reference to a given MemcachedClient for a short period of time, like that of a method.  The ClientManager will keep the MemcachedClient around, and always give you the reference to the most up-to-date object.

On #2, no need to call the shutdown() until you're actually shutting down your application.  It can (and should!) live for a long time in a typical application.

On #3, the client manager may exit if you delete the bucket, but if you try to reinstantiate it after recreating the bucket it should be fine.

Hope that helps,

- Matt

Top
  • 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