Community
Participate
Working Groups
Build Identifier: 2.1.1.v20100817-r8050 root cause : it generates an incorrect sql hint statement for oracle database which results an empty list. Wrong: /*+ FIRST_ROWS */ Correct: /*+ FIRST_ROWS(n) */ DataBase: oracle11g eclipselinkversion: eclipselink-2.1.1.v20100817-r8050 Reproducible: Always Steps to Reproduce: 1. query.setFirstResult(0); 2. query.setMaxResults(10); 3. list = query.getResultList(); // fetching the empty list even though records are available.
For me the query is generated the same ... SELECT * FROM (SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum FROM (SELECT t1.ID AS a1, ... FROM ZBM t1 LEFT OUTER JOIN MEL t0 ON (t0.ID = t1.MESSAGE_ID) LEFT OUTER JOIN EGS t2 ON (t2.ID = t1.EVENT_ID) LEFT OUTER JOIN BES t3 ON (t3.ID = t1.EVENTDATA_ID)) a WHERE ROWNUM <= ?) WHERE rnum > ? bind => [10, 0] But it works for me Eclipselink 2.1.1.v20100817-r805 Oracle 11g (11.2.0.1.0)
But I want to add that he is correct with saying that the hint should be "FIRST_ROWS(n)" or "FIRST_ROWS_n" and not just "FIRST_ROWS" http://www.dba-oracle.com/art_orafaq_oracle_first_rows_sql_optimization.htm
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
I am not sure wether to set this to works for me, as the query does return results (and another poster confirmed as well), or as a duplicate of the enhancement request: https://bugs.eclipse.org/bugs/show_bug.cgi?id=282682 Please vote for the enhancement if that was what intended. *** This bug has been marked as a duplicate of bug 282682 ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink