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: Second level cache and many-to-many mapping
PostPosted: Tue Dec 20, 2005 4:20 pm 
Newbie

Joined: Tue Oct 18, 2005 2:49 pm
Posts: 13
Hibernate version:2.x

Name and version of the database you are using:Oracle 9x

I wonder if anybody ever ran into this situation before. I have a many-to-many association that I need to eager fetch. I have second level caching enable using OSCache.

So i set outer-join=true in the <set> element as well as in its (nested) <many-to-many> element. Also set <cache-usage> elements in the class as well as the set.

This works fine first time as hibernate uses a left outer join to fetch the set. But when i hit refresh, I see the n+1 selects for the same query.

I understand that setting cache-usage in the set will cache the associations too for a one-to-many type deal. Is there some way to do this for many to many.

I must mention that my join table is not mapped or modeled as it contains only primary key info on both sides.

Thanks,
Pratik


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.