[hibernate-dev] Query#iterate

Christian Beikov christian.beikov at gmail.com
Fri Jan 27 13:17:27 EST 2017


I'm sorry, I apparently confused iterate() with scroll() then, so forget 
what I wrote before ^^

In face of that new info, I actually don't know of any actual users. 
After thinking a bit about it, why not make that behavior configurable 
via setProperty and drop that method?

Am 27.01.2017 um 19:01 schrieb Steve Ebersole:
> On Fri, Jan 27, 2017 at 9:51 AM Christian Beikov 
> <christian.beikov at gmail.com <mailto:christian.beikov at gmail.com>> wrote:
>
>     I just know of people that are using iterate() now for efficient
>     incremental processing, but I guess any other approach(streams maybe?)
>     to do incremental processing would be good enough for these users.
>
>
> ScrollableResults do not meet that need?
>
>     Unfortunately I don't know what a shallow query is or what the
>     implication on the query or the processing of being shallow are.
>
>
> Just what I said before.  "shallow" is simply a boolean flag that is 
> part of the translator.  It is set to true when the translation is 
> triggered from Query#iterate.  When the translation is triggered from 
> Query#list or Query#scroll it is set to false.
>
>     I guess this has to do with how row processing is done?
>
>
> The main thing is effects is the SQL we render.  For "entity returns" 
> it simply selects the ids and we expect to then load them 
> (immediately!) by that id (N+1).  Its usefulness is actually VERY 
> limited in scope as it actually performs horrendously in, what, 95-99% 
> of use cases?
>
> Interestingly it really does not have much effect on "row processing".
>



More information about the hibernate-dev mailing list