-->
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.  [ 5 posts ] 
Author Message
 Post subject: ScrollableResults does not work with manyvalued associations
PostPosted: Fri Jul 09, 2010 4:42 pm 
Newbie

Joined: Fri Jul 09, 2010 3:55 pm
Posts: 4
We are using the following query with ScrollableResults:
"SELECT o FROM Order o left outer join fetch o.orderLines ol " +
"WHERE o.nextShipDate <= :nsd ORDER BY o.nextShipDate";

In other words the Order has a list of orderLines that we eagerly fetch, from the Query we get the cursor:
ScrollableResults itemCursor = query.scroll(ScrollMode.SCROLL_INSENSITIVE);

and then we iterate over the cursor to get all the Orders.

We see no issues with the Order entities returned by the cursor however when we iterate over the lists of OrderLines that belong to a given Order we see that there is only one entity when in reality it should be populated with multiple elements. All the Orders have just one OrderLine when in reality should have multiple.
We have checked the SQL generated by Hibernate is correct and if instead of using Hibernate.Query#scroll() we use javax.persistence.Query#getResultList() we see that in this case the list of OrderLines for a given Order is correct.

We are using hibernate-entitymanager and hibernate-annotations 3.4.0.GA
We have run out of ideas on what could be the problem so any help will be greatly appreciated.


Top
 Profile  
 
 Post subject: Re: ScrollableResults does not work with manyvalued associations
PostPosted: Thu Jul 15, 2010 12:57 pm 
Newbie

Joined: Fri Jul 09, 2010 3:55 pm
Posts: 4
We have not been able to resolve this issue, we have tried using Criteria instead of the hibernate Query but the result is the same. When we iterate over the cursor for each Order we get an incorrect number of OrderLines.

Using the jpa javax.persistence.Query#getResultsList() instead of the org.hibernate.Query#scroll() works.

Please let us know if you have any info.


Top
 Profile  
 
 Post subject: Re: ScrollableResults does not work with manyvalued associations
PostPosted: Thu Jul 15, 2010 1:33 pm 
Newbie

Joined: Fri Jul 09, 2010 3:55 pm
Posts: 4
We have found the following open jira:

http://opensource.atlassian.com/project ... e/HHH-1283

Any one knows when there is going to be a patch for this issue?


Top
 Profile  
 
 Post subject: Re: ScrollableResults does not work with manyvalued associations
PostPosted: Wed Sep 01, 2010 2:26 am 
Newbie

Joined: Tue Aug 31, 2010 1:17 pm
Posts: 2
I can't believe there's a ticket for such a critical issue open for more than 5 years now...

Seriously, does anyone expect this bug to be fixed within the next 5 years..?

(Sorry for being ironic)


Top
 Profile  
 
 Post subject: Re: ScrollableResults does not work with manyvalued associations
PostPosted: Tue Sep 21, 2010 4:39 am 
Newbie

Joined: Tue Aug 31, 2010 1:17 pm
Posts: 2
Uhm... hello..? Critical Bug..? Anyone interested..?


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