-->
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.  [ 6 posts ] 
Author Message
 Post subject: 1) caching strategies; 2) collection of subclasses loading
PostPosted: Fri Oct 24, 2003 11:00 am 
Beginner
Beginner

Joined: Fri Oct 24, 2003 10:45 am
Posts: 22
Would be really grateful for any help -

1) Now I am doing evaluation of several OMR products and Hibernate seems to be the best. But our project badly needs some caching. As far as I understand Hibernate supports 3 caching strategies for process (JVM) level cache - read-write, nonstrict-read-write and read-only. I understand the purpose of each strategy but could not find any description of implementation. For example, at what point records get added to chache, get locked etc., what happens when we use read-only strategy but try to modify an object....? What is implementation difference between read-write and nonstrict-read-write strategies....?

Whould be really nice if somebody can give me a link with good description.

Also can anybody please advise how to deal with distributed (cluster-level) cache synchronization problem?

2) I have the same problem as described in

http://forum.hibernate.org/viewtopic.ph ... criminator

can anybody please advise any workaround?


Top
 Profile  
 
 Post subject: one more question
PostPosted: Fri Oct 24, 2003 11:18 am 
Beginner
Beginner

Joined: Fri Oct 24, 2003 10:45 am
Posts: 22
3) Does anybody know why Hibernate team insists on not using discriminator for loading collections from the table which contains records of dirrerent types? For some reason they offer to use "where" clause in collection mapping. It helps in the case of one-to-many collection but it doesn't help in the case of many-to-many (see 2 above).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 24, 2003 4:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
The reason is

(a) performance
(b) mapping a single relational association to multiple object associations is evil non-use of polymorphism (just bad OO design), IMO


Top
 Profile  
 
 Post subject: thanks, Gavin, but ....
PostPosted: Fri Oct 24, 2003 5:12 pm 
Beginner
Beginner

Joined: Fri Oct 24, 2003 10:45 am
Posts: 22
This is the quote from Hibernate manual (4.1.13):

"Finally, polymorphic persistence requires the declaration of each subclass of the root persistent class. For the (recommended) table-per-class-hierarchy mapping strategy, the <subclass> declaration is used."

But you said that it is a bad design... Probably I missed something...

I our particular project we have department class which aggregates collections of PermamentEmployee and Contractor classes. Those two classes have the common ancestor Employee and stored in the same table because they have very subtle differences...

In any case appreciate you help and sorry for being so persistent:))


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 24, 2003 5:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I thought we were talking about collections??


Top
 Profile  
 
 Post subject: clarification
PostPosted: Fri Oct 24, 2003 8:32 pm 
Beginner
Beginner

Joined: Fri Oct 24, 2003 10:45 am
Posts: 22
Yes, I was talking about collections.

But I have elements of my collections stored in the same table (as long as they have common superclass). As far as I understand that is recommended approach. For example, I have abstract class Employee and instances of its subclasses PermanentEmployee and TemporaryEmployee are stored in the same table.

And I have a class Department which aggregates two collections - permanent and temporary employees.

Moreover, Department and Employee relationship is many-to-many.

In this case I have problem when I try to load Department graph


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