OpenJPA
  1. OpenJPA
  2. OPENJPA-1580

Using firstResult and maxResults in queries is not working properly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta2
    • Fix Version/s: 2.0.0-beta3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 9.10, Maven 2.2.1, Spring 3.0.1

      Description

      Hi again,
      I try to implement a paged resultset using the firstResult and maxResults method of the Query class. It seems that this is not working as expected.

      Here is the relevant part of the logging.

      DEBUG,Query,main] Executing query: select s from SimpleEntity s order by s.id
      [DEBUG,SQL,main] <t 2132679615, conn 651497704> executing prepstmnt 558185842 SELECT LIMIT 0 2 t0.id, t0.version, t0.base, t0.street, t0.my_name FROM some_objects t0 ORDER BY t0.id ASC
      [DEBUG,Query,main] Executing query: select s from SimpleEntity s order by s.id
      [DEBUG,SQL,main] <t 2132679615, conn 651497704> executing prepstmnt 2094184728 SELECT LIMIT 0 2 t0.id, t0.version, t0.base, t0.street, t0.my_name FROM some_objects t0 ORDER BY t0.id ASC

      Both queries are identical. So my guess is once more the trouble comes from the query cache.

      1. openjpa1580.tar
        7 kB
        Oliver Ringel
      2. OPENJPA-1580.patch
        4 kB
        Fay Wang

        Activity

        Hide
        Oliver Ringel added a comment -

        Hi Fay, your patch fixed the bug. Thanks.

        Show
        Oliver Ringel added a comment - Hi Fay, your patch fixed the bug. Thanks.
        Hide
        Fay Wang added a comment -

        Yes, this is again related to the cache. A patch will be posted soon.

        Show
        Fay Wang added a comment - Yes, this is again related to the cache. A patch will be posted soon.
        Hide
        Fay Wang added a comment -

        Sorry, i just found out your attached test case.

        Show
        Fay Wang added a comment - Sorry, i just found out your attached test case.
        Hide
        Fay Wang added a comment -

        Hi Oliver, could you attache a test case or code snippet?

        Show
        Fay Wang added a comment - Hi Oliver, could you attache a test case or code snippet?
        Hide
        Oliver Ringel added a comment -

        Here is the test case.

        Show
        Oliver Ringel added a comment - Here is the test case.

          People

          • Assignee:
            Unassigned
            Reporter:
            Oliver Ringel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development