-->
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.  [ 2 posts ] 
Author Message
 Post subject: Does hibernate search utilize second level cache
PostPosted: Thu Jul 12, 2007 3:58 pm 
Newbie

Joined: Mon May 07, 2007 8:37 pm
Posts: 15
I have second level cache enabled in my app using:
Code:
            <property name="hibernate.cache.use_second_level_cache" value="true"/>
            <property name="hibernate.cache.provider_class" value="org.hibernate.cache.OSCacheProvider"/>
            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>


I can see the effect of caching when I load entities by PK. When I do search, however, I find search results always loaded from db, because after I search once, and modify db records by hand, the next search always turns up the latest information. I thought hibernate search uses Lucene to find the id, and then loads it from db. If that is the case, the loading part should be from cache. Does it not?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 6:41 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Like query.list() ignore the first/second level cache and query.iterate() benefit from the first/second level cache in HQL queries,
fullTextQuery.list() will ignore the caches and fullTextQuery.iterate() will use them.

Note that if you retrieve more than one entity type, the caches are always used.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.