-->
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.  [ 3 posts ] 
Author Message
 Post subject: Caching hibernate lists
PostPosted: Fri Sep 17, 2004 7:56 am 
Newbie

Joined: Fri Sep 17, 2004 7:33 am
Posts: 5
Location: Europe
Hi,

I am working at Helsinki University portal project, where we are using hibernate and Spring-framework as a base for our system. We have everything working quite perfectly, except for few issues with caching.

In our setup we have a node - tree, where we quite often query node children for a node and also use node data. What we have so far seen is that nodes themselves get cached very well, but whenever we get node children - query will be sent all the way to jdbc.

In the hibernate conf we have:

<class name="fi.hy.sitetree.Node" table="nodes" lazy="true">

<cache usage="read-write"/>
....
<many-to-one name="parent" class="fi.hy.sitetree.Node" column="parent_id" />
...
<list name="children" lazy="true" cascade="delete">
<key column="parent_id" />
<index column="position" type="int" />
<one-to-many class="fi.hy.sitetree.Node" />
</list>
...


I'm using IronEyeSQL to log all the queries that come down to the jdbc-driver - and see clearly that getting node data will be called only once - and node children will be called once for each request.

Is there something that could be done to also to cache these lists?

_________________
-huima


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 17, 2004 7:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You need to add the <cache> element to the collection definition as well.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 17, 2004 4:39 pm 
Newbie

Joined: Sat May 29, 2004 2:16 pm
Posts: 1
Thanks for the tip. :)


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