These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Stats say no cache hit or put!
PostPosted: Mon Mar 03, 2008 7:14 am 
Newbie

Joined: Mon Mar 03, 2008 7:04 am
Posts: 2
Hibernate version: 3.2.5.ga
Name and version of the database you are using: Mysql 5.0

I have been Doing performance testing of my application. And i am looking at the stats generated by org.hibernate.stat.Statistics to look at the stats.

It seem like the query cache is not used at all. Even for same equeries that get executed more than 1000 times the Cache put and hit count are zero!

Whats wrong ? Are the stats correct? Or i am not using Query cache at all? FI not Why?

My Hibernate is configured like :


Code:
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
        <property name="hibernate.connection.datasource">SOME JINDI HERE</property>
        <property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</property>
        <property name="hibernate.show_sql">true</property>
        </session-factory>
</hibernate-configuration>



Any sort of help will be appreciated.

Thanks,

Pike


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 7:38 am 
Newbie

Joined: Mon Mar 03, 2008 7:04 am
Posts: 2
OK i even tried adding following property:

<property name="hibernate.cache.use_query_cache">true</property>

Now a few qeries are cached but 98% are not even put in the cache. Why only couple of qeries are put in the query cache?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 06, 2008 3:35 pm 
Beginner
Beginner

Joined: Thu Jan 31, 2008 6:35 am
Posts: 27
pike wrote:
OK i even tried adding following property:

<property name="hibernate.cache.use_query_cache">true</property>

Now a few qeries are cached but 98% are not even put in the cache. Why only couple of qeries are put in the query cache?

did you use
Code:
criteria.setCacheable(true);
in your Java code ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 1:27 pm 
Newbie

Joined: Mon Feb 18, 2008 7:01 pm
Posts: 5
Are you set up to generate statistics? I am using Spring and needed to add <prop key="hibernate.generate_statistics">true</prop>
to my hibernate properties


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 1:40 pm 
Newbie

Joined: Mon Feb 18, 2008 7:01 pm
Posts: 5
Are you set up to generate statistics? I am using Spring and needed to add <prop key="hibernate.generate_statistics">true</prop>
to my hibernate properties


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 1:40 pm 
Newbie

Joined: Mon Feb 18, 2008 7:01 pm
Posts: 5
Are you set up to generate statistics? I am using Spring and needed to add <prop key="hibernate.generate_statistics">true</prop>
to my hibernate properties


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.