Issue in configuring connection timeout for spymemcached

107 views
Skip to first unread message

SONAL AGARWAL

unread,
May 2, 2013, 2:37:12 AM5/2/13
to hibernate...@googlegroups.com
Hi,

Can you tell me how to configure spymemcached properties via hibernate?
We are using com.googlecode.hibernate.
memcached.MemcachedCacheProvider class as hibernate.cache.provider_class
I have found property to confgiure operationTimeout but could not find way to configure maxReconnectDelay or FailureMode, or any other way to set connection timeout.

If server crashes down or is unavailable, we dont want client to retry again n again for that request to connect to server.
I am getting lot of exceptions:

2013-05-01 04:48:39.821 WARN net.spy.memcached.MemcachedConnection:  Closing, and reopening {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=2, #iq=0, topRop=null, topWop=net.spy.memcached.protocol.ascii.StoreOperationImpl@45ae90c9, toWrite=0, interested=0}, attempt 141.
2013-05-01 04:49:09.851 INFO net.spy.memcached.MemcachedConnection:  Reconnecting {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=2, #iq=0, topRop=null, topWop=net.spy.memcached.protocol.ascii.StoreOperationImpl@45ae90c9, toWrite=0, interested=0}
2013-05-01 04:49:09.852 INFO net.spy.memcached.MemcachedConnection:  Connection state changed for sun.nio.ch.SelectionKeyImpl@261b2759
2013-05-01 04:49:09.852 INFO net.spy.memcached.MemcachedConnection:  Reconnecting due to failure to connect to {QA sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=2, #iq=0, topRop=null, topWop=net.spy.memcached.protocol.ascii.StoreOperationImpl@45ae90c9, toWrite=0, interested=0}
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
    at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:414)
    at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:278)
    at net.spy.memcached.MemcachedClient.run(MemcachedClient.java:1981)

Nikhil Jagtap

unread,
May 2, 2013, 7:21:48 AM5/2/13
to hibernate...@googlegroups.com
Hi,

Can you paste the code of Hibernate configuration file??



--
You received this message because you are subscribed to the Google Groups "hibernate-memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hibernate-memca...@googlegroups.com.
To post to this group, send email to hibernate...@googlegroups.com.
Visit this group at http://groups.google.com/group/hibernate-memcached?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

SONAL AGARWAL

unread,
May 6, 2013, 2:25:49 AM5/6/13
to hibernate...@googlegroups.com

Hi,

These are the hibernate configurations for using memcached via spymemcached :

        <entry key="hibernate.dialect" value="com.wavemarket.wmutils.hibernate.dialect.UTF8MySQL5InnoDBDialect" />
        <entry key="hibernate.show_sql" value="false" />
        <entry key="hibernate.cache.use_second_level_cache" value="true"/>
        <entry key="hibernate.cache.use_query_cache" value="true" />
        <entry key="hibernate.cache.provider_class" value="com.googlecode.hibernate.memcached.MemcachedCacheProvider" />
        <entry key="hibernate.memcached.operationTimeout" value="500" />

-Sonal
To unsubscribe from this group and stop receiving emails from it, send an email to hibernate-memcached+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages