users@jpa-spec.java.net

[jpa-spec users] Re: JPA_SPEC-99: Add ability to stream the result of a query execution

From: Jo Desmet <jo_desmet_at_yahoo.com>
Date: Fri, 5 May 2017 21:59:33 -0700

Expect magic : yes.
Feeling tricked : very tricked.

If it is going to be backed by an in-memory List object, then do not return an Iterator or Stream at all. Then what we deserve to - and should - get is a List. No halfway implementations, I am already having a hard time explaining why streaming directly over http is better than building resultsets in a string to concatenation it in displaying in a JSP ... so don't make streaming a fake choice ...

Well said and captured my sentiment.

Sent from my iPad

> On May 4, 2017, at 11:58 PM, Oliver Gierke <ogierke_at_pivotal.io> wrote:
>
> When people call a method returning a Stream they seem to expect a lot of magic happening, i.e. a real stream of result elements. If the default implementation then just reads everything at once and basically calls List.stream(), some users might feel tricked.