[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2383?page=c...
]
Arne Ansper commented on HHH-2383:
----------------------------------
The problem seems to arise from the special treatment of the case when firstResult is 0.
getLimitString constructs different SQL statement when hasOffset is false. When offset is
0 SQL starts like this:
SELECT *
FROM
(SELECT saddocumen0_.id AS col_0_0_,
When offset > 0 SQL starts like this:
SELECT *
FROM
(SELECT row_.*,
rownum rownum_
FROM
(SELECT saddocumen0_.id AS col_0_0_,
Apparently Oracle does some optimizations that results in different order of rows for
those two queries. When I ran the second SQL for rows 0 - pagesize, I got consistent
results.
I suggest to remove the special treatment of the case when offset is 0 to get consistent
results.
Generated SQL using setMaxResults/setFirstResult duplicate entities
in the first page and subsequent pages in Oracle.
---------------------------------------------------------------------------------------------------------------------
Key: HHH-2383
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2383
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.2
Environment: Hibernate 3.2.2 GA, Oracle 10
Reporter: Carlos Eugênio P. da Purificação
Attachments: test.zip
Original Estimate: 4 days
Remaining Estimate: 4 days
The generated SQL using setMaxResults/setFirstResult duplicate entities in the first page
and subsequent pages.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira