Derby
  1. Derby
  2. DERBY-4352

With 10.3 or later client and 10.1 server NullPointerException attempting to execute closed cursor

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.5.3.0
    • Fix Version/s: None
    • Component/s: Network Client
    • Labels:
      None
    • Issue & fix info:
      Newcomer, Repro attached
    • Bug behavior facts:
      Regression

      Description

      Using 10.5 client and 10.1 server I get a NullPointerException with the following script:
      [C:/test] java -Dij.exceptionTrace=true org.apache.derby.tools.ij
      ij version 10.1
      ij> run 'repro.sql';
      ij> connect 'jdbc:derby://localhost:1527/wombat;create=true';
      Connection number: 3.
      ij> drop table t1;
      0 rows inserted/updated/deleted
      ij> create table t1 (c1 int);
      0 rows inserted/updated/deleted
      ij> insert into t1 (c1) values (1),(2),(3);
      3 rows inserted/updated/deleted
      ij> get cursor curs1 as 'select * from t1 for update of c1';
      ij> prepare curs1 as 'update t1 set c1=c1 where current of curs1';
      ij> next curs1;
      C1
      -----------
      1
      ij> close curs1;
      ij> execute curs1;
      JAVA ERROR: java.lang.NullPointerException
      java.lang.NullPointerException
      at org.apache.derby.client.am.SectionManager.getPositionedUpdateResultSet(SectionManager.java:193)
      at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2018)
      at org.apache.derby.client.am.PreparedStatement.executeX(PreparedStatement.java:1594)
      at org.apache.derby.client.am.PreparedStatement.execute(PreparedStatement.java:1579)
      at org.apache.derby.impl.tools.ij.ij.ExecuteStatement(Unknown Source)
      at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
      at org.apache.derby.tools.ij.main(Unknown Source)

      I used the following script to set up my environment.
      export JAVA_HOME=C:/p4/marsden_trunk/ibm15
      export PATH="$JAVA_HOME/bin;$PATH"
      export JUNIT="C:/svn/tools/junit.jar"
      export ORO="C:/svn/tools/jakarta-oro-2.0.8.jar"
      export TEN5JARS=C:/kmarsden/projects/10.5.3testing/db-derby-10.5.3.0-lib-debug/lib
      export TEN1JARS=c:/kmarsden/svnreleases/jars/10.1.3.1
      export CLASSPATH=".;$JUNIT;$ORO;$TEN1JARS/derby.jar;$TEN1JARS/derbynet.jar;$TEN1JARS/derbytools.jar;$TEN5JARS/derbyclien
      t.jar;$TEN1JARS/derbyTesting.jar"
      java org.apache.derby.tools.sysinfo

      [C:\kmarsden\svnreleases\jars\10.1.3.1\derby.jar] 10.1.3.1 - (417277)
      [C:\kmarsden\svnreleases\jars\10.1.3.1\derbynet.jar] 10.1.3.1 - (417277)
      [C:\kmarsden\svnreleases\jars\10.1.3.1\derbytools.jar] 10.1.3.1 - (417277)
      [C:\kmarsden\projects\10.5.3testing\db-derby-10.5.3.0-lib-debug\lib\derbyclient.jar] 10.5.3.0 - (802917)

      I actually found the failure by running derbynetclientmats in this environment and saw it in the forupdate test.

      1. repro.sql
        0.3 kB
        Kathey Marsden

        Activity

        Hide
        Rick Hillegas added a comment -

        Changing the description since it appears that this behavior has been in the codeline since 10.3.

        I find that I get an NPE if the client is 10.3 or later and the server is 10.1. I ran my experiments with a 10.1.3.1 server and various clients. I observed the following results

        If the client is 10.3.3.0, 10.4.2.0, or 10.5.1.1, then I get an NPE on the final statement.

        If the client is 10.2.2.0, then I get this error on the final statement: "ERROR XCL16: ResultSet not open. Verify that autocommit is OFF."

        If the client is 10.1.3.1, then I get this error on the final statement: "ERROR (no SQLState): ResultSet for cursor CURS1 is closed."

        I am curious about the original experiment: The ij output indicates that the client is at 10.1, not 10.5. Perhaps I am misunderstanding this bug.

        Show
        Rick Hillegas added a comment - Changing the description since it appears that this behavior has been in the codeline since 10.3. I find that I get an NPE if the client is 10.3 or later and the server is 10.1. I ran my experiments with a 10.1.3.1 server and various clients. I observed the following results If the client is 10.3.3.0, 10.4.2.0, or 10.5.1.1, then I get an NPE on the final statement. If the client is 10.2.2.0, then I get this error on the final statement: "ERROR XCL16: ResultSet not open. Verify that autocommit is OFF." If the client is 10.1.3.1, then I get this error on the final statement: "ERROR (no SQLState): ResultSet for cursor CURS1 is closed." I am curious about the original experiment: The ij output indicates that the client is at 10.1, not 10.5. Perhaps I am misunderstanding this bug.
        Hide
        Kathey Marsden added a comment -

        Thank you Rick for verifying back to 10.3.

        In the original experiment derbytools.jar was from 10.1 and that is why I think it showed 10.1 in ij. derbyclient.jar was 10.5.

        Show
        Kathey Marsden added a comment - Thank you Rick for verifying back to 10.3. In the original experiment derbytools.jar was from 10.1 and that is why I think it showed 10.1 in ij. derbyclient.jar was 10.5.
        Hide
        Kathey Marsden added a comment -

        Closing as Won't fix as part of 10.8 Triage. The mixed versions involved are fairly old and it is a negative case. It can be reopened if hit by a user that can't work around it.

        Show
        Kathey Marsden added a comment - Closing as Won't fix as part of 10.8 Triage. The mixed versions involved are fairly old and it is a negative case. It can be reopened if hit by a user that can't work around it.
        Hide
        Knut Anders Hatlen added a comment -

        [bulk update] Close all resolved issues that haven't been updated for more than one year.

        Show
        Knut Anders Hatlen added a comment - [bulk update] Close all resolved issues that haven't been updated for more than one year.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kathey Marsden
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development