vaseems / xmemcached

Automatically exported from code.google.com/p/xmemcached
Apache License 2.0
0 stars 0 forks source link

Touch does not work #244

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce:
1. Run memcached
2. Put item into cache
3. Run touch command

I got the:
MemcachedClient operation fail
net.rubyeye.xmemcached.exception.MemcachedException: 
net.rubyeye.xmemcached.exception.UnknownCommandException
    at net.rubyeye.xmemcached.XMemcachedClient.checkException(XMemcachedClient.java:1884)
    at net.rubyeye.xmemcached.XMemcachedClient.touch(XMemcachedClient.java:1899)
    at net.rubyeye.xmemcached.XMemcachedClient.touch(XMemcachedClient.java:1909)
    at MainTest.main(MainTest.java:35)
Caused by: net.rubyeye.xmemcached.exception.UnknownCommandException

And following in memcached output:
>188 Writing an error: Unknown command
>188 Writing bin response:
>188   0x81 0x1c 0x00 0x00
>188   0x00 0x00 0x00 0x81
>188   0x00 0x00 0x00 0x0f
>188   0x00 0x00 0x00 0x00
>188   0x00 0x00 0x00 0x00
>188   0x00 0x00 0x00 0x00

Memcached: 1.4.4-14 (for Windows) - I tried on Linux as well and it does not 
work
XMemcached version: 1.3.8

Code to use:
MemcachedClientBuilder builder = new XMemcachedClientBuilder(
                AddrUtil.getAddresses("localhost:11211"));
        builder.setCommandFactory(new BinaryCommandFactory());
        MemcachedClient memcachedClient = builder.build();
        try {
            memcachedClient.set("hello", 0, "Hello,xmemcached");
            String value = memcachedClient.get("hello");
            System.out.println("hello=" + value);
            System.out.println("result of rouch = " + memcachedClient.touch("hello", 1));
            System.out.println("hello=" + value);
        } catch (MemcachedException e) {
            System.err.println("MemcachedClient operation fail");
            e.printStackTrace();
        } catch (TimeoutException e) {
            System.err.println("MemcachedClient operation timeout");
            e.printStackTrace();
        } catch (InterruptedException e) {
            // ignore
        }

Original issue reported on code.google.com by vkviatko...@gmail.com on 1 Jan 2013 at 2:30

GoogleCodeExporter commented 9 years ago
memcached 1.4.8 begin to support touch:

https://code.google.com/p/memcached/wiki/ReleaseNotes148

Original comment by killme2...@gmail.com on 8 Jan 2013 at 11:50