-->
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: Disabling outer join in session.refresh()
PostPosted: Fri Nov 03, 2006 5:48 am 
Newbie

Joined: Fri Nov 03, 2006 5:15 am
Posts: 2
Hibernate version: 3.1.2

Background:
I have a bidirectional, non-lazy one-to-many association between two domain objects. We use Oracle10g database and have implemented optimistic locking using ORA_ROWSCN meta-column as version column in Hibernate. A bug in Oracle makes ORA_ROWSCN not to work in outer join queries.

Problem:
When fetching the object that has a set of another objects using
Code:
   getHibernateTemplate().get(DomainObject1Impl.class, id);
everything goes well (the fetching is done without outer join in SQL level, two different queries gets executed). But when calling
Code:
   session.refresh(domainObject1)
the refresh query contains outer join for some reason I cannot understand (only one query gets executed).

I have tried to disable the outer join by putting different combinations of fetch="select" and outer-join="false" attributes in both ends of the association, but that seems not to help.

Question:
How can I disable outer join from the refresh query?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 19, 2008 3:22 am 
Beginner
Beginner

Joined: Thu Nov 15, 2007 11:27 am
Posts: 34
I'm digging the forum, but I got exactly the same problem and the solution, so if it can help people:

Add
hibernate.max_fetch_depth=0
in hibernate.properties file.

(this solution expect that you never really want to use outer join in mapping)


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.