users@glassfish.java.net

Re: Toplink + Postgresql select result paginating

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Fri, 20 Mar 2009 17:53:11 -0700

Toplink Essentials (the default persistence provider for V2) does not
support pagination using LIMIT and OFFSET on PostgreSQL. You can switch
to using EclipseLink which does support that.

glassfish_at_javadesktop.org wrote:
> Hello
>
> I want to read object returned from JPQL query in small chunks. I've use code like that:
>
> q.setFirstResult(from);
> q.setMaxResults(count);
> q.getResultList()
>
> in a loop until empty list returned. Unfortunately each iteration of loop executes select SQL query without LIMIT and OFFSET clauses simply ignoring unwanted rows.
>
> Anybody knows how to force right behavior in this situation?
>
> AS: Sun Java System Application Server 9.1_02 (build b04-fcs)
> Database: PostgreSQL Version: 8.1.11
> Driver: PostgreSQL Native Driver Version: PostgreSQL 8.3 JDBC4 with SSL (build 603)
> Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/17/2008))
>
>