MemCachedClient.set always returns false

Toru Maesaka tmaesaka at gmail.com
Sun Feb 24 03:24:08 UTC 2008


If your record was successfully set then the verbose output
should say something like:

<7 set somekey 0 0 __bytes__
>7 STORED

If you don't see that output then you're never going to succeed in
fetching that record. The output that you've provided is telling me
that memcached tried to find the record that you've asked for but
couldn't find it.

If memcached has succesfully found and sent the record back to
the client then you should see this output for your case:

<7 get somekey
>7 sending key somekey
>7 END

So the set related code in your program isn't working.

Good luck :)

Toru

On Sun, Feb 24, 2008 at 8:14 AM, William Chu <willchu at gmail.com> wrote:
> Hi,
>
> I'm trying to use set from the MemCachedClient and it is always returning
> false. I am using -vv on the server side to print verbose.
>
> The memcached server does not print any statements when I "set". It always
> returns false. I am using the java client library
>
>
> However, there are statements on the server when I "get" (although I get
> nothing - since nothing was set)
>
> When I get, on the server I see this:
> <7 get somekey
> >7 END
>
>
> here are some more print statements from the server
>  <7 new client connection
> <8 new client connection
> <7 get somekey
>  >7 END
> <8 connection closed.
> <7 connection closed.
> <7 new client connection
> <8 new client connection
> <7 get will
>
>
>
> String key   = "somekey";
>
> boolean isSet  = mc.set(key, object);
>  System.out.println ("it was successullly set: " + isSet); // always returns
> false
>
>  Object object =  mc.get(key);
>  if (object == null) {
> System.out.println ("object is null")
> }
>
>


More information about the memcached mailing list