Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1002

Select range doesn't work on Oracle JDBC driver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0, 1.2.1, 1.3.0, 2.0.0-M2
    • 1.2.0, 2.0.0-M3
    • jdbc
    • None
    • OS: windows XP professional
      java version 1.5.0_14
      Oracle jdbc driver 10.2.0.1.0
    • Patch Available

    Description

      Select range doesn't work on Oracle with Oracle jdbc driver 10.2.0.1.0.
      The test case is like below:
      OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
      FetchPlan fetch = (FetchPlan) pm.getFetchPlan();
      fetch.addField(EagerOuterJoinPC.class, "stringList");
      fetch.setFetchBatchSize(3);
      OpenJPAQuery q = pm.createQuery(JPQLParser.LANG_JPQL,
      "select x from EagerOuterJoinPC x order by x.name asc");
      q.setFirstResult(5).setMaxResults(15);

      List results = (List) q.getResultList();
      assertEquals(5, results.size());

      The assertion passed on Derby. But failed on Oracle:
      junit.framework.AssertionFailedError: expected:<5> but was:<10>
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.Assert.failNotEquals(Assert.java:282)
      at junit.framework.Assert.assertEquals(Assert.java:64)
      at junit.framework.Assert.assertEquals(Assert.java:201)
      at junit.framework.Assert.assertEquals(Assert.java:207)
      at org.apache.openjpa.persistence.jdbc.meta.TestEagerOuterToManyJoins.testQueryRange(TestEagerOuterToManyJoins.java:679)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at org.apache.openjpa.persistence.test.PersistenceTestCase.run(PersistenceTestCase.java:127)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

      Attachments

        1. 1002_Headtrunk.patch
          4 kB
          Ravi Prakash Palacherla
        2. 1002.patch
          8 kB
          Amy Yang
        3. TestEagerOuterToManyJoins1.java
          4 kB
          Ravi Prakash Palacherla

        Activity

          People

            mikedd Michael Dick
            amy Amy Yang
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: