bigdata4u / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

MemCached more no of Queries are executing #268

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

      We are facing a problem with memcache. We are using hibernate-memcached-version1.5-SNAPSHOT and spymemcached-provider-version3.0.2. 

The following are the configuration

persistence.xml
---------------

<!-- Enable 2nd Level Cache  -->
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<!-- MemCache Configuration -->
<property name="hibernate.cache.region.factory_class" 
value="com.googlecode.hibernate.memcached.MemcachedRegionFactory"/>
<property name="hibernate.cache.use_minimal_puts" value="true"/>
<property name="hibernate.cache.use_structured_entries" value="true"/>
<property name="hibernate.memcached.servers" 
value="${hibernate.memcached.server.host.port}"/>
<property name="hibernate.memcached.cacheTimeSeconds" value="1800"/>

dto
----

@Cacheable(true)
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)

In GenericDao we are setting query hints cacheable to true for loadAll().

We are using loadAll() method to fetch all the records. 
Whenever we made a request the loadAll query is executing and also the queries 
based on id are executing.

Please let me know we are missing anything. 

Original issue reported on code.google.com by shaikirf...@gmail.com on 30 Jan 2013 at 12:40

GoogleCodeExporter commented 8 years ago
I guess this is a different project than the core one. You may raise an issue 
here? 

https://github.com/raykrueger/hibernate-memcached

Original comment by michael....@gmail.com on 30 Jan 2013 at 12:45

GoogleCodeExporter commented 8 years ago
Hi michael when i refer to the log am able to notice that the data is fetching 
from database and setting in memcache for a request and when we make another 
request instead of fetching the data from the memcache it is hitting again to 
the db and again setting to memcache. Am unable to understand that without 
modifying any data why it is hitting to db?

Original comment by shaikirf...@gmail.com on 30 Jan 2013 at 2:13

GoogleCodeExporter commented 8 years ago
Thanks for the quick rply

Original comment by shaikirf...@gmail.com on 30 Jan 2013 at 2:13

GoogleCodeExporter commented 8 years ago
Hi,

again, this doesn't sound as it would be related to the spymemcached project. 
Please ask over there why this can happen, maybe your @Cacheable annotations 
are either not picked up or something else is not correctly configured. If you 
hit an issue with spy itself, feel free to reopen this ticket.

Thanks.

Original comment by michael....@gmail.com on 30 Jan 2013 at 2:54