-->
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: General Question about L2 / Query Cache
PostPosted: Sun Oct 22, 2006 12:28 pm 
Newbie

Joined: Thu May 04, 2006 3:53 pm
Posts: 11
Hi,

could someone point me to a document / article / Javadoc / anything that explains the in-depth workings of the L2 Cache ? I am particularly interesting in information about how it works (and why) about uncommitted transactions..

Basically, what I am doing is Importing 2+ million entries inside a single transaction.
For a few objects and Queries :
- If I use my own HashMap to cache the results, X iterations take 1 second.
- If I use Hibernate's L2 Cache + Query Cache, X iterations take 30 seconds.

=> My guess was that the cache was not used, so I started analyzing the debug logs.

And what appears to me (I may be wrong, please correct me), is that :
- Once an insert is committed, everything works perfectly
- However, if an insert is followed by selects, in the same transaction, Hibernate L2 / Query cache does NOT work as expected.

For each query, I get something like that :
52924 DEBUG [main] org.hibernate.cache.StandardQueryCache - Checking query s
paces for up-to-dateness: [AbstractAdministrativeEntity, Country]
52924 DEBUG [main] org.hibernate.cache.EhCache - key: AbstractAdmi
nistrativeEntity
52924 DEBUG [main] org.hibernate.cache.UpdateTimestampsCache - [AbstractAdmi
nistrativeEntity] last update timestamp: 4757644239814656, result set timestamp:
4757643992637440
52924 DEBUG [main] org.hibernate.cache.StandardQueryCache - cached query res
ults were not up to date


So, why are the results not up to date ? It does NOT happen if I commit the data, (in this case, I get a cache hit).

Thanks for your help,
Sami Dalouche


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 22, 2006 4:01 pm 
Newbie

Joined: Thu May 04, 2006 3:53 pm
Posts: 11
Oh, and something I am wondering about..

If I issue two consecutive queries in the non-committed transaction :

34099 DEBUG [main] org.hibernate.cache.UpdateTimestampsCache - [AbstractAdmi
nistrativeEntity] last update timestamp: 4757693121622016, result set timestamp:
4757692874911744


34114 DEBUG [main] org.hibernate.cache.UpdateTimestampsCache - [AbstractAdmi
nistrativeEntity] last update timestamp: 4757693121622016, result set timestamp:
4757692874911744


I have the exact same timestamps.. What do they mean exactly ?

Thanks for your help
Sami Dalouche


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.