-->
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 caching?
PostPosted: Fri Jan 20, 2006 9:18 pm 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
How to turn on Hibernate caching? How it works?

I have a scenario and like to know if Hibernate caching is in the picture.

A category has a parent category.

class Category {

@ManyToOne(fetch=FetchType.EAGER)
public Category getParent();


}

Category is a tree structure.

Suppose category A has a child category B.

when A is retrieved, all its parents until the root will be retrived because of EAGER: root-->A1-->A2-> ....-->A.

When I ask for category B that is a child of A, its parents until root will be retrieved from user's perspective. Will Hibernate go to the database to read its parent categories from A to the root again? Or can Hibernate cache it so that only B will be retrieved from database and its parents will be from the cache?

The same question for collection with JoinTable. Is there any cache going on? How to configure it ?

Thanks for advice.

Dave


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.