Derby
  1. Derby
  2. DERBY-256

ASSERTION when attempting to execute a statement after shutdown of database with network Server

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 10.1.2.1
    • Fix Version/s: None
    • Component/s: Network Server
    • Urgency:
      Normal

      Description

      java -Dij.protocol=jdbc:derby:net://localhost:1527/ -Dij.user=I -Dij.password=mine org.apache.derby.tools.ij

      – create and connect to the databases
      ij> connect 'wombat;create=true';
      ij> connect 'myDB;create=true';

      – shutdown database wombat
      – ERROR 08006 expected
      ij(CONNECTION1)> connect 'wombat;shutdown=true';
      Connection number: 3.
      ERROR 08006: wombat?(server log XXXX)?atabase 'wombat'
      shutdown.?08006.D
      com.ibm.db2.jcc.am.SqlException: wombat?(server log XXX) Database 'wombat'
      shutdown.?08006.D

      ij(CONNECTION1)> show connections;
      CONNECTION0 -
      jdbc:db2j:net://localhost:1527/wombat;create=true
      CONNECTION1* -
      jdbc:db2j:net://localhost:1527/myDB;create=true

      • = current connection
        ij(CONNECTION1)> select * from sys.systables;
        • system tables are returned
          15 rows selected

      – shutdown database myDB
      – ERROR 08006 expected
      ij(CONNECTION1)> connect 'mydb;shutdown=true';
      Connection number: 4.
      ERROR 08006: mydb?(server
      log:XXXX)Database 'mydb'
      shutdown.?08006.D
      com.ibm.db2.jcc.am.SqlException: mydb?(server
      log: XXX)Database 'mydb'
      shutdown.?08006.D

      ij(CONNECTION1)> show connections;
      CONNECTION0 -
      jdbc:db2j:net://localhost:1527/wombat;create=true
      CONNECTION1* -
      jdbc:db2j:net://localhost:1527/myDB;create=true

      • = current connections
        ij(CONNECTION1)> select * from sys.systables;
        com.ibm.db2j.protocol.BasicServices.Errors.AssertFailure:
        ASSERT FAILED connection is closed
        at
        com.ibm.db2j.protocol.BasicServices.SanityService.SanityManager.
        ASSERT(SanityManager.java:124)
        at
        com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalConnection.prepar
        eCall(LocalConnection.java:887)
        at
        com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalConnection.prepar
        eCall(LocalConnection.java:842)
        at
        com.ibm.db2j.drda.DRDAConnThread.parseSQLDTA_work(DRDAConnThread
        .java:3771)
        at
        com.ibm.db2j.drda.DRDAConnThread.parseSQLDTA(DRDAConnThread.java
        :3694)
        at
        com.ibm.db2j.drda.DRDAConnThread.parseEXCSQLSTTobjects(DRDAConnT
        hread.java:3576)
        at
        com.ibm.db2j.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.j
        ava:3422)
        at
        com.ibm.db2j.drda.DRDAConnThread.processCommands(DRDAConnThread.
        java:848)
        at
        com.ibm.db2j.drda.DRDAConnThread.run(DRDAConnThread.java:235)
        agentThread[DRDAConnThread_4,5,main]
        ERROR 08003: DB2 SQL error: SQLCODE: -1, SQLSTATE: 08003,
        SQLERRMC: (server log:C:\mark52\test\users\test\db2j.log)?No
        current connection.?08003
        com.ibm.db2.jcc.am.SqlException: (server
        log:C:\mark52\test\users\test\db2j.log)?No current
        connection.?08003
        at
        com.ibm.db2.jcc.am.Statement.completeSqlca(Statement.java:1459)

      at
      com.ibm.db2.jcc.t4.T4StatementReply.parsePrepareError(T4Statemen
      tReply.java:594)
      at
      com.ibm.db2.jcc.t4.T4StatementReply.parsePRPSQLSTTreply(T4Statem
      entReply.java:141)
      at
      com.ibm.db2.jcc.t4.T4StatementReply.readPrepareDescribeOutput(T4
      StatementReply.java:42)
      at
      com.ibm.db2.jcc.t4.StatementReply.readPrepareDescribeOutput(Stat
      ementReply.java:31)
      at
      com.ibm.db2.jcc.t4.T4Statement.readPrepareDescribeOutput_(T4Stat
      ement.java:142)
      at
      com.ibm.db2.jcc.am.Statement.readPrepareDescribeOutput(Statement
      .java:1062)
      at
      com.ibm.db2.jcc.am.Statement.flowExecute(Statement.java:1702)
      at
      com.ibm.db2.jcc.am.Statement.executeX(Statement.java:666)
      at
      com.ibm.db2.jcc.am.Statement.execute(Statement.java:650)
      at
      com.ibm.db2j.tools.ijImpl.ij.executeImmediate(ij.java:261)
      at
      com.ibm.db2j.tools.ijImpl.utilMain.doCatch(utilMain.java:427)
      at
      com.ibm.db2j.tools.ijImpl.utilMain.go(utilMain.java:306)
      at com.ibm.db2j.tools.ijImpl.Main.go(Main.java:202)
      at
      com.ibm.db2j.tools.ijImpl.Main.mainCore(Main.java:168)
      at com.ibm.db2j.tools.ijImpl40.Main.main(Main.java:49)
      at com.ibm.db2j.tools.ij.main(ij.java:51)
      ij(CONNECTION1)>
      com.ibm.db2j.protocol.BasicServices.Errors.AssertFailure:
      ASSERT FAILED connection is closed
      at
      com.ibm.db2j.protocol.BasicServices.SanityService.SanityManager.
      ASSERT(SanityManager.java:124)
      at
      com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalConnection.prepar
      eCall(LocalConnection.java:887)
      at
      com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalConnection.prepar
      eCall(LocalConnection.java:842)
      at
      com.ibm.db2j.drda.DRDAConnThread.parseSQLDTA_work(DRDAConnThread
      .java:3771)
      at
      com.ibm.db2j.drda.DRDAConnThread.parseSQLDTA(DRDAConnThread.java
      :3694)
      at
      com.ibm.db2j.drda.DRDAConnThread.parseEXCSQLSTTobjects(DRDAConnT
      hread.java:3576)
      at
      com.ibm.db2j.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.j
      ava:3422)
      at
      com.ibm.db2j.drda.DRDAConnThread.processCommands(DRDAConnThread.
      java:848)
      at
      com.ibm.db2j.drda.DRDAConnThread.run(DRDAConnThread.java:235)

      1. repro.sql
        0.4 kB
        Kathey Marsden

        Issue Links

          Activity

          Hide
          Dag H. Wanvik added a comment -

          I tried this with the derby client and got similar behavior - it seems the shutdown doesnt lead to the "open_" flag in the client's Connection being set to false. The first select after the shutdown achieves this though, hence the changed behavior in the second select attempt.

          > connect 'mydb;shutdown=true';
          Connection number: 9.
          ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'mydb' shutdown.

          CONNECTION1)> show connections;
          CONNECTION0 - jdbc:derby://localhost:1527/wombat;create=true
          CONNECTION1* - jdbc:derby://localhost:1527/mydb;create=true

          • = current connection

          ij(CONNECTION1)> select * from sys.systables;
          ERROR 58009: Execution failed due to a distribution protocol error that caused deallocation of the conversation. The
          requestedcommand encountered an unarchitected and implementation specific condition for which there was no
          architected message.

          ij(CONNECTION1)> select * from sys.systables;
          ERROR (no SQLState): invalid operation: connection closed

          Show
          Dag H. Wanvik added a comment - I tried this with the derby client and got similar behavior - it seems the shutdown doesnt lead to the "open_" flag in the client's Connection being set to false. The first select after the shutdown achieves this though, hence the changed behavior in the second select attempt. > connect 'mydb;shutdown=true'; Connection number: 9. ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'mydb' shutdown. CONNECTION1)> show connections; CONNECTION0 - jdbc:derby://localhost:1527/wombat;create=true CONNECTION1* - jdbc:derby://localhost:1527/mydb;create=true = current connection ij(CONNECTION1)> select * from sys.systables; ERROR 58009: Execution failed due to a distribution protocol error that caused deallocation of the conversation. The requestedcommand encountered an unarchitected and implementation specific condition for which there was no architected message. ij(CONNECTION1)> select * from sys.systables; ERROR (no SQLState): invalid operation: connection closed
          Hide
          Kathey Marsden added a comment -

          It is probably best to focus on why we are seeing the assertion on the server side. I think the server should be throwing an SQLException instead of this assertion.
          com.ibm.db2j.protocol.BasicServices.Errors.AssertFailure:
          ASSERT FAILED connection is closed
          at
          com.ibm.db2j.protocol.BasicServices.SanityService.SanityManager.
          ASSERT(SanityManager.java:124)
          at
          com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalConnection.prepar
          eCall(LocalConnection.java:887)
          at

          If the server does the right thing the client state should take care of itself I think

          Show
          Kathey Marsden added a comment - It is probably best to focus on why we are seeing the assertion on the server side. I think the server should be throwing an SQLException instead of this assertion. com.ibm.db2j.protocol.BasicServices.Errors.AssertFailure: ASSERT FAILED connection is closed at com.ibm.db2j.protocol.BasicServices.SanityService.SanityManager. ASSERT(SanityManager.java:124) at com.ibm.db2j.impl.Connectivity.JDBC.Local.LocalConnection.prepar eCall(LocalConnection.java:887) at If the server does the right thing the client state should take care of itself I think
          Hide
          Mike Matrigali added a comment -

          Triaged July 10, 2009: assigned normal urgency.

          Show
          Mike Matrigali added a comment - Triaged July 10, 2009: assigned normal urgency.
          Hide
          Knut Anders Hatlen added a comment -

          The class names in the server-side stack trace indicate that it was not the Derby network server that was used (for example: com.ibm.db2j.drda.DRDAConnThread).

          Kathey, are you able to reproduce the assertion using Derby's network server?

          Show
          Knut Anders Hatlen added a comment - The class names in the server-side stack trace indicate that it was not the Derby network server that was used (for example: com.ibm.db2j.drda.DRDAConnThread). Kathey, are you able to reproduce the assertion using Derby's network server?
          Hide
          Kathey Marsden added a comment -

          Against trunk running the attached repro.sql started with:
          java -Dij.protocol=jdbc:derby://localhost:1527/ org.apache.derby.tools.ij

          I see the protocol error Dag described. I don't see the assertion failure in the derby.log. To avoid confusion, the best thing to do would be to close this one cannot reproduce and open up a new bug for the protocol error.

          Show
          Kathey Marsden added a comment - Against trunk running the attached repro.sql started with: java -Dij.protocol=jdbc:derby://localhost:1527/ org.apache.derby.tools.ij I see the protocol error Dag described. I don't see the assertion failure in the derby.log. To avoid confusion, the best thing to do would be to close this one cannot reproduce and open up a new bug for the protocol error.
          Hide
          Kathey Marsden added a comment -

          Closing cannot reproduce as the assertion failure does not reproduce. Filed a new issue DERBY-5626 for the client side protocol error that does occur with the reproduction

          Show
          Kathey Marsden added a comment - Closing cannot reproduce as the assertion failure does not reproduce. Filed a new issue DERBY-5626 for the client side protocol error that does occur with the reproduction
          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:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development