-->
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: Fetching strategies
PostPosted: Wed Nov 02, 2005 4:20 am 
Newbie

Joined: Wed Nov 02, 2005 4:03 am
Posts: 7
Hibernate version: 3 / JBoss 4.0.3 / EJB3.0
Name and version of the database you are using: Oracle 9i

With EJB3.0 I've some problems with fetching strategies, because some things don't seem do be the same as with plain Hibernate (and work different than documented).

The docs say, all associations are lazy by default. However, in my configuration all to-one-associations seem to be eager by default. Why? Is this EJB3.0?

The docs say, eager associations are fetched by additional selects by default. However, in my configuration, all such associations are fetched in gigantic joins; if I don't manually tell some "lazys" to some to-one-associations, Hibernate selects nearly the entire database in one single join.

Criteria.setFechMode() does not seem to work at all. It neither gives errors for invalid paths (I've seen this is a bug which is open at least since Hibernate 2), nor has it any effect with correct paths.

Can you help me???

Thank you!

Marcus.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 02, 2005 7:04 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hi,
Point to me the Hibernate Entity Manager reference documentation mistakes or lacks and I'll fix them.

http://www.hibernate.org/hib_docs/entitymanager/reference/en/html_single/

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Lazy vs. Eager vs. Proxy
PostPosted: Fri Nov 04, 2005 1:20 pm 
Newbie

Joined: Thu Sep 01, 2005 8:43 am
Posts: 14
Hi,

I was wondering - the EJB3.0 public draft specifies that OneToOne and ManyToOne associations are eagerly fetched per default.

On the other hand the Hibernate 3.1 reference states:
Quote:
By default, Hibernate3 uses lazy select fetching for collections and lazy proxy fetching for single-valued associations.
These defaults make sense for almost all associations in almost all applications.


So what is the case if one relies on the defaults... Must admit - I was lazy and never tried :)

cu,
landels


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.