-->
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: Subselect fetching executes query for every entry in keyset
PostPosted: Thu Feb 02, 2017 1:51 pm 
Newbie

Joined: Thu Feb 02, 2017 1:38 pm
Posts: 2
I am debugging a weird occassion where the SUBSELECT fetch strategy doesn't seem to work. The use case: from a list of A, get all lists of B. Instead of running the query to get B once, it runs the query once for every A. The ran queries are exactly the same, the where-in subselect gets properly injected and all duplicates have the same parameter values. I have been stepping through the SubselectOneToManyLoader code but it is not trivial where exactly this goes wrong. For instance, the "keys" array is filled properly with all 1254 ids of the fetched entities. I have been suspicious about whether this could be a bug in Hibernate, but so far I couldn't reproduce this with a "clean-slate". I am therefore looking for input desperately ;)

A few thoughts:
* Even though Hibernate should support Streams, could it be that a Stream of the below form breaks the SUBSELECT fetching?
List of A's -> stream -> map list of B's -> flat map stream -> consume

* Could it be that SUBSELECT fetching does not work properly on enhanced entities? (hibernate-enhance-maven-plugin)

* Could it be that a custom OneToMany persister breaks the SUBSELECT fetch strategy? (I am using the https://github.com/Blazebit/blaze-persi ... ister.java )

* Could it be that SUBSELECT fetching does not work with SortNatural?

* Could it be that SUBSELECT fetching does not work properly with inheritance trees or multiple collection fields that use SUBSELECT fetching?


Any input will be much appreciated!


Jan-Willem


Top
 Profile  
 
 Post subject: Re: Subselect fetching executes query for every entry in keyset
PostPosted: Thu Feb 02, 2017 3:47 pm 
Newbie

Joined: Thu Feb 02, 2017 1:38 pm
Posts: 2
It seems this particular issue does not occur when I use proxies as opposed to enhanced entities. Are there any known issues for the enhancer related to class hierarchies (InheritanceType.JOINED) or generics? OR any other thoughts why sub-select fetching couldn't work with enhanced entities?


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.