-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate and Caching, various Questions
PostPosted: Mon May 16, 2011 6:14 am 
Newbie

Joined: Mon Jan 24, 2011 1:38 pm
Posts: 8
Hello together,

I use Hibernate 3.6 and Im pretty new to it. Im interested in using the 2nd Level Cache for it and Ive got various questions about it. It would be great if someone could answer them:

1. Is it correct that the 1st and 2nd Level Cache only cache objects which are loaded/stored/changed by Primary Key?

2. What about using Joins (which maybe not exclusively use the PK to request Data) - can the 1st and 2nd Level Cache be used for them?

3. What about the other requests which are not using the PK? I mean often there exist a lot of them, so I dont really understand why its not possible to use Caching for them (beside from Query Caching)

4. What would you say: when does it make sense to use the 2nd level cache? of course when Ive got a lot of database operations, but I think that data which is changed a lot(!!) shouldnt be cached, because synchronising the cache with the database does also decrease the performance. Thats why I think 2nd Level Cache should be only used for data for which more Read-Operations then Write-Operations are done. What do you think about that?

5. I read that for each table a CacheConcurrencyStrategy can be set, which influences the behaviour of hibernate of how data should be cached (and invalidated). Is that correct?

6. What about the CacheMode? It can be (additional to the CacheConcurrenyStrategy) set for the Hibernate-Session itself, so that it tells the Hibernate-Session if it should use the 2nd Level Cache or not? What sense does this make, when the EhCache is already configured for every table (to be used or not and in which way (only read, read-write and so on) Why should I additional say then "the session shall not write in the 2nd Level Cache, but read from it"? Sorry, I may be a little bit stupid, but could someone explain this maybe with a small example to me? that would be great :-)

Thanks a lot for your help!! :-)


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

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.