Hello,

Yes, jOOQ defaults to eager materialisation of a database result set, as
that's what people mostly want, as opposed to JDBC's lazy materialisation.
If you explicitly want lazy materialization, use... fetchLazy() :-)

- http://www.jooq.org/javadoc/latest/org/jooq/ResultQuery.html#fetchLazy--

You can also influence the JDBC fetchSize via:

-
http://www.jooq.org/javadoc/latest/org/jooq/ResultQuery.html#fetchSize-int-

This will allow you to further control the amount of cached rows in your
JDBC ResultSet

More information here:
http://www.jooq.org/doc/latest/manual/sql-execution/fetching/lazy-fetching/

Cheers
Lukas

2014-09-19 18:26 GMT+02:00 Jim McGlaughlin <[email protected]>:

> The jOOQ query part is working nicely, returns about 2K results in a
> second for 1 point in time.
>
>         SelectConditionStep<Record6<Integer, Integer, Double, Double, Byte
> , Integer>> records = ivDsl.select( sample.SAMPLENO, sample.THRESHID,
> sample.V1, sample.V2, adj.TPL, thr.DESCID )
>                 .from(sample)
>                 .join(adj).on(adj.THRESHID.eq(sample.THRESHID))
>                 .join(thr).on(thr.THRESHID.equal(thr.THRESHID))
>                 .where(sample.SAMPLENO.between(lastDashboardSampleno,
> lastIvSample + 1))
>                 ;
>
>
> BUT, when I try to get results I am running out of heap space.
>
> I think the code below is getting all the results at once, I would like to
> get one Record6 at a time.  In my starting code below I am getting each
> item in Record6 one at a time.  Eventually I would like to fetch them into
> an object or map.
>
>         for (Record6<Integer, Integer, Double, Double, Byte, Integer>
> record6 : records.fetch()) {
>             Integer sampleno = (Integer)record6.value1();
>             Integer threshid = (Integer)record6.value2();
>             Double   v1       = (Double)record6.value3();
>             Double   v2       = (Double)record6.value4();
>             Byte     tpl     = (Byte)record6.value5();
>             Integer descid   = (Integer)record6.value6();
>         }
>
>
>
>
>
>  --
> 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 to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to