Thank you. Alright so AFAIK, maybe besides fiddling with the spliterator,
there's no straightforward way of processing chunks from a stream. I guess
I'd better be off working with a Cursor directly. I've seen fetchLazy does
not accept a RecordMapper callback. Is there any way of using one when
lazily fetching ? I haven't seen anything in the doc and I'd like to avoid
a RecordN leaking from my repository.
Le mardi 13 mars 2018 17:11:55 UTC+1, Lukas Eder a écrit :
> It's easy to explain.
> A "jOOQ Stream" is really just a wrapper around a "jOOQ Cursor" with some
> convenient API.
> A "jOOQ Cursor" is really just an Iterator wrapper around a JDBC ResultSet
> with some convenient API.
> Now, every time a "jOOQ Stream" or a "jOOQ Cursor" pulls another value
> from the underlying JDBC ResultSet, there is some JDBC action going on.
> This directly translates to all terminal stream operations in their natural
> To answer your question: Like any call to collect(), a call to collect()
> on a "jOOQ Stream" will iterate the entire ResultSet and collect stuff,
> just like a call to forEach() will iterate the entire ResultSet and do
> stuff with each row.
> Hope this helps,
>> Of course. Just one last question regarding Jooq if you don't mind.
>> With a Cursor I can understand how it works... Like, it maintains an open
>> ResultSet and you can fetch X records in a loop, do stuff with them and
>> repeat. But how does Jooq handles that with a stream ? Is it abstracted ?
>> You said it won't load everything into memory in my example using a
>> forEach, but is it the case for all terminal stream operations ? Surely if
>> I collect or sorted it will load everything right ?
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.