-->
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: Hibernate cache and relations
PostPosted: Wed Jul 21, 2010 3:48 pm 
Beginner
Beginner

Joined: Sun Apr 25, 2010 7:14 am
Posts: 30
Hi,

i am trying to get the 2nd level cache working properly with different kind of relations. According to what i've
read the following is true:

OneToMany:
Changes have to be done on both sides (setParent on the many side and collection.add on the one side). If
something deleted by Cascade.DELETE i have to evict all affected collections from the cache.

ManyToMany:
I don't know.

Could anybody tell me wether the OneToMany part is correct and where i can find information according
to ManyToMany relations. The best thing would be a page with all necessary information to cache and all
relation types.

Thanks a lot!

Yours
Werzi2001


Top
 Profile  
 
 Post subject: Re: Hibernate cache and relations
PostPosted: Thu Jul 22, 2010 5:14 am 
Beginner
Beginner

Joined: Sun Apr 25, 2010 7:14 am
Posts: 30
Argh... i totally get crazy with this.
Do i really have to manage the ManyToMany relation on both sides? Even though i tell hibernate using mappedBy what
the "main" side is? Do i really have to manage Cascade.DELETE manually in order to clear all related caches? And this
for maybe hundreds of beans and dozens of relations?

This would probably turn the 2nd level cache into a very questionable thing :(


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.