Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Memcached does not work,Seek help!!!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ZAC陀  
View profile  
 More options Oct 15 2012, 4:25 am
From: ZAC陀 <vemaci...@gmail.com>
Date: Mon, 15 Oct 2012 01:25:09 -0700 (PDT)
Local: Mon, Oct 15 2012 4:25 am
Subject: Memcached does not work,Seek help!!!

hi,everybody!

My match is spring mvc + mybatis + shiro , The version of jar is simple-spring-memcached-3.0.2
, xmemcached-1.3.8 , xmemcached-provider-3.0.2 ,
mybatis-memcached-1.0.0-beta1.jar.

The XML configuration:

           mapper.xml(mybatis) : <mapper namespace="Account">
                               <cache
type="org.mybatis.caches.memcached.MemcachedCache" />

           Configuration.xml(mybatis) : <setting name="cacheEnabled"
value="true" />

           applicationContext.xml(spring):   <import
resource="classpath:simplesm-context.xml" />

<aop:aspectj-autoproxy />
                                                          <bean
name="defaultMemcachedClient" class="com.google.code.ssm.CacheFactory">

<property name="cacheName" value="defaultCache" />

<property name="cacheClientFactory">

<bean name="cacheClientFactory"
class="com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl"
/>

</property>
                                                                  <property
name="addressProvider">

<bean class="com.google.code.ssm.config.DefaultAddressProvider">

<property name="address" value="127.0.0.1:11211" />

</bean>

</property>
                                                                  <property
name="configuration">

<bean class="com.google.code.ssm.providers.CacheConfiguration">

<property name="consistentHashing" value="true" />

</bean>
                                                                 </property>
                                                     </bean>

I didn't set on a UserMyBatisDaoImp proxy, but on the service, because  
UserMyBatisDaoImp extends  SqlSessionDaoSupport ,

So, my service is used like this:

    @ReadThroughMultiCache(namespace = "user", expiration = 600, option =
@ReadThroughMultiCacheOption(generateKeysFromResult = true))
    public List<User> getAllUser(@ParameterValueKeyProvider final
List<Long> ids) {
        return (List<User>) mybatisDao.selectList();
    }

I just want to query a collection of all, don't want to incoming parameters
,so the Controller be used like this:

        List<Long> ids= Arrays.asList(1L, 2L);
        List<User> users =accountManager.getAllUser(ids);

I set the @CacheKeyMethod or not,or set service like this:

   @ReadThroughMultiCache(namespace = "user", expiration = 600)
    public List<User> getAllUser(@ParameterValueKeyProvider final
List<Long> ids) {
        return (List<User>) mybatisDao.selectList();
    }

Memcached does not run set / get , Always perform a database query .

The log4j content of the output is only xmemcached heartbeat messages.

I have no idea, ask everybody to help, thank you very much !!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic