-->
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: Query Cache behaviour which I don't understand
PostPosted: Tue Mar 23, 2010 7:37 pm 
Newbie

Joined: Tue Mar 23, 2010 6:49 pm
Posts: 1
I'm seeing the following behaviour in Hibernate 3.3.2 which doesn't fit my mental model of how Sessions and the Query Cache work.

I'm using two sessions from the same thread:

1. Session A: do a select using a candidate key -- but defined as <properties ... unique="true">, not using <natural-id>, and the select is done via a Query, not a Criteria
2. Session B: insert a row with the candidate key we just looked for.
3. Session A: select the new row using it's unique key -- we find it.
4. Session A: select the new row using the candidate key -- we don't find it.

I expected the insert to invalidate the query cache, but it seems it doesn't. If I add a SessionFactory.evictQueries() as step 3.5 then step 4 does find the row.

The timestamp cache is correctly configured.

What's going on?


Top
 Profile  
 
 Post subject: Re: Query Cache behaviour which I don't understand
PostPosted: Wed Mar 24, 2010 4:23 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
What's going on?


Code:
log4j.logger.org.hibernate.cache.StandardQueryCache=DEBUG
log4j.logger.org.hibernate.cache.UpdateTimestampsCache=DEBUG


I would suggest to activate following loggings (see above), and to report then again the output.


Quote:
The timestamp cache is correctly configured.

Correctly configured means that its entries must not be evicted ever (= eternal cache).
Do you configured the update timestamp cache as eternal?


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.