Derby
  1. Derby
  2. DERBY-4315

Attempt to reuse streams in client on insert gives protocol exception and inserts wrong data

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.6.1.0
    • Fix Version/s: 10.7.1.1, 10.8.1.2
    • Component/s: JDBC
    • Urgency:
      Urgent
    • Issue & fix info:
      High Value Fix, Repro attached, Workaround attached
    • Bug behavior facts:
      Embedded/Client difference, Wrong query result

      Description

      If a user attempts to reuse a stream set as a parameter to a prepared statement, the statement execution should fail with SQL State XJ001. Instead client fails with a protocol error and inserts wrong data. See the attached java program ReproReuseStream.java for a reproduction.
      [C:/kmarsden/repro/reusestream] java ReproReuseStream
      Insert row 1
      Try to insert row 2 with reused streams
      java.sql.SQLException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been
      padded with 0x0.
      at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96)
      at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358)
      at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:399)
      at ReproReuseStream.main(ReproReuseStream.java:41)
      Caused by: org.apache.derby.client.am.SqlException: Network protocol error: end of stream prematurely reached, parameter
      #4. Remaining data has been padded with 0x0.
      at org.apache.derby.client.net.Request.writePlainScalarStream(Request.java:490)
      at org.apache.derby.client.net.Request.writeScalarStream(Request.java:264)
      at org.apache.derby.client.net.NetStatementRequest.buildEXTDTA(NetStatementRequest.java:951)
      at org.apache.derby.client.net.NetStatementRequest.writeExecute(NetStatementRequest.java:147)
      at org.apache.derby.client.net.NetPreparedStatement.writeExecute_(NetPreparedStatement.java:178)
      at org.apache.derby.client.am.PreparedStatement.writeExecute(PreparedStatement.java:1801)
      at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2031)
      at org.apache.derby.client.am.PreparedStatement.executeUpdateX(PreparedStatement.java:404)
      at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:390)
      ... 1 more
      Go ahead and commit so we can see the wrong data.
      ID |MNAME

      MVALUE BYTEDATA
      CHARDATA

      ------------------------------------------------------------------------------------------------------------------------
      ------------------------------------------------------------------------------------------------------------------------
      ------------------------------------------------------------------------------------------------------------------------
      --------------------------------------------------
      1 |mname

      0 636363636363636363636363636363636363636363636363636363636363636363636363636363636363636
      3636363636363636363636363636363636363636&
      cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      ccccccccccccccccccccccccccccccccccccccccccccccccc&
      2
      mname
      0 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000&

      &

      To workaround the issue users should not attempt to reuse streams but we should give a better message and not insert wrong data.

      The code was extracted from StreamingColumnTest testDerby500 but the commits were removed.

      1. derby-4315-01-aa-regularizeExceptionHandling.diff
        1.0 kB
        Rick Hillegas
      2. derby-4315-01-ab-regularizeExceptionHandling.diff
        5 kB
        Rick Hillegas
      3. derby-4315-02-aa-cleanupEndOfStreamMessage.diff
        0.7 kB
        Rick Hillegas
      4. ReproReuseStream.java
        3 kB
        Rick Hillegas
      5. ReproReuseStream.java
        2 kB
        Kathey Marsden
      6. StreamError.java
        4 kB
        Rick Hillegas

        Issue Links

          Activity

          Hide
          Kathey Marsden added a comment -

          Right now this bocks the DERBY-4312 fix because StreamingColumnTest fails.

          Show
          Kathey Marsden added a comment - Right now this bocks the DERBY-4312 fix because StreamingColumnTest fails.
          Hide
          Kathey Marsden added a comment - - edited

          Attaching reproduction for this issue. Start network server and run java ReproReuseStream

          Show
          Kathey Marsden added a comment - - edited Attaching reproduction for this issue. Start network server and run java ReproReuseStream
          Hide
          Kathey Marsden added a comment -

          This is perhaps a more specific case of DERBY-2017, but maybe there is something specific that can be done for stream reuse if a general solution is too hard.

          Show
          Kathey Marsden added a comment - This is perhaps a more specific case of DERBY-2017 , but maybe there is something specific that can be done for stream reuse if a general solution is too hard.
          Hide
          Kathey Marsden added a comment -

          verified back to 10.1

          Show
          Kathey Marsden added a comment - verified back to 10.1
          Hide
          Dag H. Wanvik added a comment -

          I think it would be OK if Derby just throws an exception indicating EOF here, since we probably won't support using the same stream for two placeholders in a prepared statement either.

          Show
          Dag H. Wanvik added a comment - I think it would be OK if Derby just throws an exception indicating EOF here, since we probably won't support using the same stream for two placeholders in a prepared statement either.
          Hide
          Kristian Waagan added a comment -

          Note that from 10.6 (both client and server must be 10.6 or later) padded data won't be inserted into the database. This was fixed by DERBY-2017.

          Show
          Kristian Waagan added a comment - Note that from 10.6 (both client and server must be 10.6 or later) padded data won't be inserted into the database. This was fixed by DERBY-2017 .
          Hide
          Rick Hillegas added a comment -

          The fix for DERBY-2017 appears to have stopped Derby from inserting bogus data. The protocol error remains, though. Here's what the repro produces now:

          Drop exception ok:'DROP TABLE' cannot be performed on 'TEST' because it does not exist.
          Insert row 1
          Try to insert row 2 with reused streams
          java.sql.SQLException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0.
          at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96)
          at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358)
          at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:403)
          at ReproReuseStream.main(ReproReuseStream.java:41)
          Caused by: org.apache.derby.client.am.SqlException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0.
          at org.apache.derby.client.net.Request.writePlainScalarStream(Request.java:339)
          at org.apache.derby.client.net.Request.writeScalarStream(Request.java:247)
          at org.apache.derby.client.net.NetStatementRequest.buildEXTDTA(NetStatementRequest.java:983)
          at org.apache.derby.client.net.NetStatementRequest.writeExecute(NetStatementRequest.java:152)
          at org.apache.derby.client.net.NetPreparedStatement.writeExecute_(NetPreparedStatement.java:178)
          at org.apache.derby.client.am.PreparedStatement.writeExecute(PreparedStatement.java:1791)
          at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2021)
          at org.apache.derby.client.am.PreparedStatement.executeUpdateX(PreparedStatement.java:408)
          at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:394)
          ... 1 more
          Go ahead and commit so we can see the wrong data.
          ID |MNAME |MVALUE |BYTEDATA |CHARDATA
          --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
          1 |mname |0 |6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636&|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&

          Show
          Rick Hillegas added a comment - The fix for DERBY-2017 appears to have stopped Derby from inserting bogus data. The protocol error remains, though. Here's what the repro produces now: Drop exception ok:'DROP TABLE' cannot be performed on 'TEST' because it does not exist. Insert row 1 Try to insert row 2 with reused streams java.sql.SQLException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96) at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358) at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:403) at ReproReuseStream.main(ReproReuseStream.java:41) Caused by: org.apache.derby.client.am.SqlException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0. at org.apache.derby.client.net.Request.writePlainScalarStream(Request.java:339) at org.apache.derby.client.net.Request.writeScalarStream(Request.java:247) at org.apache.derby.client.net.NetStatementRequest.buildEXTDTA(NetStatementRequest.java:983) at org.apache.derby.client.net.NetStatementRequest.writeExecute(NetStatementRequest.java:152) at org.apache.derby.client.net.NetPreparedStatement.writeExecute_(NetPreparedStatement.java:178) at org.apache.derby.client.am.PreparedStatement.writeExecute(PreparedStatement.java:1791) at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2021) at org.apache.derby.client.am.PreparedStatement.executeUpdateX(PreparedStatement.java:408) at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:394) ... 1 more Go ahead and commit so we can see the wrong data. ID |MNAME |MVALUE |BYTEDATA |CHARDATA -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 |mname |0 |6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636&|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
          Hide
          Rick Hillegas added a comment -

          Attaching a revised version of the repro. This version runs the test on both the embedded and client/server drivers. To run this version, you need to specify the port which the server is listening on:

          java ReproReuseStream 8246

          ########################################################
          #

          1. jdbc:derby:memory:db1;create=true
            #
            ########################################################

          Drop exception ok:'DROP TABLE' cannot be performed on 'TEST' because it does not exist.
          Insert row 1
          Try to insert row 2 with reused streams
          Caught SQLException. SQLState = XSDA4
          An unexpected exception was thrown
          java.sql.SQLException: An unexpected exception was thrown
          at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
          at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
          at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:278)
          at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
          at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
          at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
          at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
          at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1333)
          at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1686)
          at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:308)
          at ReproReuseStream.execute(ReproReuseStream.java:64)
          at ReproReuseStream.main(ReproReuseStream.java:27)
          Caused by: java.sql.SQLException: An unexpected exception was thrown
          at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
          at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
          at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
          ... 11 more
          Caused by: java.sql.SQLException: Java exception: 'Stream has already been read and end-of-file reached and cannot be re-used.: java.io.EOFException'.
          at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
          at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
          at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
          at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
          at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
          at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408)
          ... 9 more
          Caused by: java.io.EOFException: Stream has already been read and end-of-file reached and cannot be re-used.
          at org.apache.derby.iapi.types.RawToBinaryFormatStream.read(RawToBinaryFormatStream.java:254)
          at org.apache.derby.impl.store.raw.data.MemByteHolder.write(MemByteHolder.java:146)
          at org.apache.derby.impl.store.raw.data.RememberBytesInputStream.fillBuf(RememberBytesInputStream.java:135)
          at org.apache.derby.impl.store.raw.data.StoredPage.logColumn(StoredPage.java:6197)
          at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:3972)
          at org.apache.derby.impl.store.raw.data.InsertOperation.writeOptionalDataToBuffer(InsertOperation.java:370)
          at org.apache.derby.impl.store.raw.data.InsertOperation.<init>(InsertOperation.java:115)
          at org.apache.derby.impl.store.raw.data.LoggableActions.actionInsert(LoggableActions.java:139)
          at org.apache.derby.impl.store.raw.data.BasePage.insertNoOverflow(BasePage.java:602)
          at org.apache.derby.impl.store.raw.data.BasePage.insertAtSlot(BasePage.java:523)
          at org.apache.derby.impl.store.raw.data.StoredPage.insertAtSlot(StoredPage.java:6771)
          at org.apache.derby.impl.store.raw.data.BasePage.insert(BasePage.java:629)
          at org.apache.derby.impl.store.access.heap.HeapController.doInsert(HeapController.java:255)
          at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(HeapController.java:599)
          at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:452)
          at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1028)
          at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:505)
          at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
          at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
          at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
          ... 4 more
          Go ahead and commit so we can see the wrong data.
          ID |MNAME |MVALUE |BYTEDATA |CHARDATA
          --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
          1 |mname |0 |6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636&|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&

          ########################################################
          #

          1. jdbc:derby://localhost:8246/memory:db2;create=true
            #
            ########################################################

          Insert row 1
          Try to insert row 2 with reused streams
          Caught SQLException. SQLState = XN017
          Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0.
          java.sql.SQLException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0.
          at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96)
          at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358)
          at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:403)
          at ReproReuseStream.execute(ReproReuseStream.java:64)
          at ReproReuseStream.main(ReproReuseStream.java:28)
          Caused by: org.apache.derby.client.am.SqlException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0.
          at org.apache.derby.client.net.Request.writePlainScalarStream(Request.java:339)
          at org.apache.derby.client.net.Request.writeScalarStream(Request.java:247)
          at org.apache.derby.client.net.NetStatementRequest.buildEXTDTA(NetStatementRequest.java:983)
          at org.apache.derby.client.net.NetStatementRequest.writeExecute(NetStatementRequest.java:152)
          at org.apache.derby.client.net.NetPreparedStatement.writeExecute_(NetPreparedStatement.java:178)
          at org.apache.derby.client.am.PreparedStatement.writeExecute(PreparedStatement.java:1791)
          at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2021)
          at org.apache.derby.client.am.PreparedStatement.executeUpdateX(PreparedStatement.java:408)
          at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:394)
          ... 2 more
          Go ahead and commit so we can see the wrong data.
          ID |MNAME |MVALUE |BYTEDATA |CHARDATA
          --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
          1 |mname |0 |6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636&|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&

          Show
          Rick Hillegas added a comment - Attaching a revised version of the repro. This version runs the test on both the embedded and client/server drivers. To run this version, you need to specify the port which the server is listening on: java ReproReuseStream 8246 ######################################################## # jdbc:derby:memory:db1;create=true # ######################################################## Drop exception ok:'DROP TABLE' cannot be performed on 'TEST' because it does not exist. Insert row 1 Try to insert row 2 with reused streams Caught SQLException. SQLState = XSDA4 An unexpected exception was thrown java.sql.SQLException: An unexpected exception was thrown at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142) at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:278) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1333) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1686) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:308) at ReproReuseStream.execute(ReproReuseStream.java:64) at ReproReuseStream.main(ReproReuseStream.java:27) Caused by: java.sql.SQLException: An unexpected exception was thrown at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) ... 11 more Caused by: java.sql.SQLException: Java exception: 'Stream has already been read and end-of-file reached and cannot be re-used.: java.io.EOFException'. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142) at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:408) ... 9 more Caused by: java.io.EOFException: Stream has already been read and end-of-file reached and cannot be re-used. at org.apache.derby.iapi.types.RawToBinaryFormatStream.read(RawToBinaryFormatStream.java:254) at org.apache.derby.impl.store.raw.data.MemByteHolder.write(MemByteHolder.java:146) at org.apache.derby.impl.store.raw.data.RememberBytesInputStream.fillBuf(RememberBytesInputStream.java:135) at org.apache.derby.impl.store.raw.data.StoredPage.logColumn(StoredPage.java:6197) at org.apache.derby.impl.store.raw.data.StoredPage.logRow(StoredPage.java:3972) at org.apache.derby.impl.store.raw.data.InsertOperation.writeOptionalDataToBuffer(InsertOperation.java:370) at org.apache.derby.impl.store.raw.data.InsertOperation.<init>(InsertOperation.java:115) at org.apache.derby.impl.store.raw.data.LoggableActions.actionInsert(LoggableActions.java:139) at org.apache.derby.impl.store.raw.data.BasePage.insertNoOverflow(BasePage.java:602) at org.apache.derby.impl.store.raw.data.BasePage.insertAtSlot(BasePage.java:523) at org.apache.derby.impl.store.raw.data.StoredPage.insertAtSlot(StoredPage.java:6771) at org.apache.derby.impl.store.raw.data.BasePage.insert(BasePage.java:629) at org.apache.derby.impl.store.access.heap.HeapController.doInsert(HeapController.java:255) at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(HeapController.java:599) at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:452) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1028) at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:505) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241) ... 4 more Go ahead and commit so we can see the wrong data. ID |MNAME |MVALUE |BYTEDATA |CHARDATA -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 |mname |0 |6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636&|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc& ######################################################## # jdbc:derby://localhost:8246/memory:db2;create=true # ######################################################## Insert row 1 Try to insert row 2 with reused streams Caught SQLException. SQLState = XN017 Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0. java.sql.SQLException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96) at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358) at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:403) at ReproReuseStream.execute(ReproReuseStream.java:64) at ReproReuseStream.main(ReproReuseStream.java:28) Caused by: org.apache.derby.client.am.SqlException: Network protocol error: end of stream prematurely reached, parameter #4. Remaining data has been padded with 0x0. at org.apache.derby.client.net.Request.writePlainScalarStream(Request.java:339) at org.apache.derby.client.net.Request.writeScalarStream(Request.java:247) at org.apache.derby.client.net.NetStatementRequest.buildEXTDTA(NetStatementRequest.java:983) at org.apache.derby.client.net.NetStatementRequest.writeExecute(NetStatementRequest.java:152) at org.apache.derby.client.net.NetPreparedStatement.writeExecute_(NetPreparedStatement.java:178) at org.apache.derby.client.am.PreparedStatement.writeExecute(PreparedStatement.java:1791) at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2021) at org.apache.derby.client.am.PreparedStatement.executeUpdateX(PreparedStatement.java:408) at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:394) ... 2 more Go ahead and commit so we can see the wrong data. ID |MNAME |MVALUE |BYTEDATA |CHARDATA -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 |mname |0 |6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636&|ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&
          Hide
          Rick Hillegas added a comment -

          Attaching StreamError.java. This class shows another error related to the exception processing in this part of our network driver.

          The attached StreamError class raises an ArrayIndexOutOfBoundsException half way through reading the input stream. All sorts of Exceptions could be raised by a user-written InputStream. But the network client only looks for IOExceptions. If the network client sees an IOException, then you get the behavior described by this bug report: the user sees a puzzling protocol error when there is no real protocol error. The error is in the InputStream which is running purely on the client-side. If the InputStream raises an exeption other than an IOException, then a protocol error does not return to the user. Instead, the error raised by the stream percolates up to higher levels of exception management in the client driver. However, in that case a real protocol error follows and you see two consequences:

          1) In the server log you see the following protocol error:

          org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of a Distributed Protocol Error: DRDA_Disconnect; CODPNT arg = 0; Error Code Value = 0,DDMReader.fill(),InputStream.read(),insufficient data,*
          at org.apache.derby.impl.drda.DRDAProtocolException.newDisconnectException(DRDAProtocolException.java:325)
          at org.apache.derby.impl.drda.DRDAConnThread.markCommunicationsFailure(DRDAConnThread.java:503)
          at org.apache.derby.impl.drda.DRDAConnThread.markCommunicationsFailure(DRDAConnThread.java:472)
          at org.apache.derby.impl.drda.DDMReader.fill(DDMReader.java:1965)
          at org.apache.derby.impl.drda.DDMReader.ensureALayerDataInBuffer(DDMReader.java:1684)
          at org.apache.derby.impl.drda.DDMReader.readDSSContinuationHeader(DDMReader.java:1225)
          at org.apache.derby.impl.drda.DDMReader.readLOBChunk(DDMReader.java:1122)
          at org.apache.derby.impl.drda.DDMReader.readLOBContinuationStream(DDMReader.java:1099)
          at org.apache.derby.impl.drda.StandardEXTDTAReaderInputStream.nextBuffer(StandardEXTDTAReaderInputStream.java:183)
          at org.apache.derby.impl.drda.StandardEXTDTAReaderInputStream.read(StandardEXTDTAReaderInputStream.java:116)
          at java.io.FilterInputStream.read(FilterInputStream.java:116)
          at org.apache.derby.iapi.services.io.LimitInputStream.read(LimitInputStream.java:74)
          at org.apache.derby.iapi.types.RawToBinaryFormatStream.read(RawToBinaryFormatStream.java:273)
          at org.apache.derby.impl.store.raw.data.MemByteHolder.write(MemByteHolder.java:146)
          at org.apache.derby.impl.store.raw.data.RememberBytesInputStream.fillBuf(RememberBytesInputStream.java:135)
          at org.apache.derby.impl.store.raw.data.StoredPage.logColumn(StoredPage.java:6197)
          at org.apache.derby.impl.store.raw.data.StoredPage.logLongColumn(StoredPage.java:6044)
          at org.apache.derby.impl.store.raw.data.InsertOperation.writeOptionalDataToBuffer(InsertOperation.java:367)
          at org.apache.derby.impl.store.raw.data.InsertOperation.<init>(InsertOperation.java:115)
          at org.apache.derby.impl.store.raw.data.LoggableActions.actionInsert(LoggableActions.java:139)
          at org.apache.derby.impl.store.raw.data.BasePage.insertLongColumn(BasePage.java:938)
          at org.apache.derby.impl.store.raw.data.BasePage.insertAllowOverflow(BasePage.java:763)
          at org.apache.derby.impl.store.raw.data.BasePage.insert(BasePage.java:632)
          at org.apache.derby.impl.store.access.heap.HeapController.doInsert(HeapController.java:307)
          at org.apache.derby.impl.store.access.heap.HeapController.insert(HeapController.java:575)
          at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:457)
          at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1028)
          at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:505)
          at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
          at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
          at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241)
          at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1686)
          at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1341)
          at org.apache.derby.impl.drda.DRDAStatement.execute(DRDAStatement.java:672)
          at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(DRDAConnThread.java:4316)
          at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.java:4133)
          at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:1021)
          at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:294)

          2) After that, an attempt to shutdown the server results in the following error on the client (the next attempt to shutdown the server succeeds, however):

          Fri Nov 19 09:00:38 PST 2010 : Invalid reply header from network server: Invalid string

          Show
          Rick Hillegas added a comment - Attaching StreamError.java. This class shows another error related to the exception processing in this part of our network driver. The attached StreamError class raises an ArrayIndexOutOfBoundsException half way through reading the input stream. All sorts of Exceptions could be raised by a user-written InputStream. But the network client only looks for IOExceptions. If the network client sees an IOException, then you get the behavior described by this bug report: the user sees a puzzling protocol error when there is no real protocol error. The error is in the InputStream which is running purely on the client-side. If the InputStream raises an exeption other than an IOException, then a protocol error does not return to the user. Instead, the error raised by the stream percolates up to higher levels of exception management in the client driver. However, in that case a real protocol error follows and you see two consequences: 1) In the server log you see the following protocol error: org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of a Distributed Protocol Error: DRDA_Disconnect; CODPNT arg = 0; Error Code Value = 0,DDMReader.fill(),InputStream.read(),insufficient data,* at org.apache.derby.impl.drda.DRDAProtocolException.newDisconnectException(DRDAProtocolException.java:325) at org.apache.derby.impl.drda.DRDAConnThread.markCommunicationsFailure(DRDAConnThread.java:503) at org.apache.derby.impl.drda.DRDAConnThread.markCommunicationsFailure(DRDAConnThread.java:472) at org.apache.derby.impl.drda.DDMReader.fill(DDMReader.java:1965) at org.apache.derby.impl.drda.DDMReader.ensureALayerDataInBuffer(DDMReader.java:1684) at org.apache.derby.impl.drda.DDMReader.readDSSContinuationHeader(DDMReader.java:1225) at org.apache.derby.impl.drda.DDMReader.readLOBChunk(DDMReader.java:1122) at org.apache.derby.impl.drda.DDMReader.readLOBContinuationStream(DDMReader.java:1099) at org.apache.derby.impl.drda.StandardEXTDTAReaderInputStream.nextBuffer(StandardEXTDTAReaderInputStream.java:183) at org.apache.derby.impl.drda.StandardEXTDTAReaderInputStream.read(StandardEXTDTAReaderInputStream.java:116) at java.io.FilterInputStream.read(FilterInputStream.java:116) at org.apache.derby.iapi.services.io.LimitInputStream.read(LimitInputStream.java:74) at org.apache.derby.iapi.types.RawToBinaryFormatStream.read(RawToBinaryFormatStream.java:273) at org.apache.derby.impl.store.raw.data.MemByteHolder.write(MemByteHolder.java:146) at org.apache.derby.impl.store.raw.data.RememberBytesInputStream.fillBuf(RememberBytesInputStream.java:135) at org.apache.derby.impl.store.raw.data.StoredPage.logColumn(StoredPage.java:6197) at org.apache.derby.impl.store.raw.data.StoredPage.logLongColumn(StoredPage.java:6044) at org.apache.derby.impl.store.raw.data.InsertOperation.writeOptionalDataToBuffer(InsertOperation.java:367) at org.apache.derby.impl.store.raw.data.InsertOperation.<init>(InsertOperation.java:115) at org.apache.derby.impl.store.raw.data.LoggableActions.actionInsert(LoggableActions.java:139) at org.apache.derby.impl.store.raw.data.BasePage.insertLongColumn(BasePage.java:938) at org.apache.derby.impl.store.raw.data.BasePage.insertAllowOverflow(BasePage.java:763) at org.apache.derby.impl.store.raw.data.BasePage.insert(BasePage.java:632) at org.apache.derby.impl.store.access.heap.HeapController.doInsert(HeapController.java:307) at org.apache.derby.impl.store.access.heap.HeapController.insert(HeapController.java:575) at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:457) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1028) at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:505) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1686) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1341) at org.apache.derby.impl.drda.DRDAStatement.execute(DRDAStatement.java:672) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(DRDAConnThread.java:4316) at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.java:4133) at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:1021) at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:294) 2) After that, an attempt to shutdown the server results in the following error on the client (the next attempt to shutdown the server succeeds, however): Fri Nov 19 09:00:38 PST 2010 : Invalid reply header from network server: Invalid string
          Hide
          Rick Hillegas added a comment -

          Attaching derby-4315-01-aa-regularizeExceptionHandling.diff. This patch causes the offending logic in the network client to catch all exceptions from InputStreams, and not just IOExceptions. Running regression tests now.

          After applying this patch, we will not see protocol errors when InputStream.read() raises an exception other than an IOException. However, those other exceptions will be wrapped with the bogus protocol error status described by this bug.

          Touches the following files:

          M java/client/org/apache/derby/client/net/Request.java

          Show
          Rick Hillegas added a comment - Attaching derby-4315-01-aa-regularizeExceptionHandling.diff. This patch causes the offending logic in the network client to catch all exceptions from InputStreams, and not just IOExceptions. Running regression tests now. After applying this patch, we will not see protocol errors when InputStream.read() raises an exception other than an IOException. However, those other exceptions will be wrapped with the bogus protocol error status described by this bug. Touches the following files: M java/client/org/apache/derby/client/net/Request.java
          Hide
          Rick Hillegas added a comment -

          Attaching a second rev of this initial patch, derby-4315-01-ab-regularizeExceptionHandling.diff. The tests ran cleanly except for a suspicious error in NetworkServerMBeanTest. I have revamped the patch to improve error messages for the cases touched by this patch. I will re-run the tests.

          The error messages no longer falsely claim that a protocol error occurred. In addition, I tried to clarify the description of how the client driver recovers from the exception.

          This is the suspicious error I saw in NetworkServerMBeanTest. When I ran the test standalone, I saw no errors. However, we know from past experience that NetworkServerMBeanTest is sensitive to interference from tests which run before it:

          1) testAttributeAccumulatedConnectionCount(org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest)java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: org.apache.derby:type=NetworkServer,system=c013800d-012c-658f-2b31-ffffe1d7aa3e
          at java.security.AccessController.doPrivileged(Native Method)
          at org.apache.derbyTesting.functionTests.tests.management.MBeanTest.getAttribute(MBeanTest.java:379)
          at org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest.testAttributeAccumulatedConnectionCount(NetworkServerMBeanTest.java:93)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
          at junit.extensions.TestSetup.run(TestSetup.java:25)
          at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
          at junit.extensions.TestSetup.run(TestSetup.java:25)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
          at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
          at junit.extensions.TestSetup.run(TestSetup.java:25)
          at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
          Caused by: javax.management.InstanceNotFoundException: org.apache.derby:type=NetworkServer,system=c013800d-012c-658f-2b31-ffffe1d7aa3e
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010)
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:627)
          at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:659)
          at org.apache.derbyTesting.functionTests.tests.management.MBeanTest$4.run(MBeanTest.java:382)
          ... 41 more

          FAILURES!!!
          Tests run: 8871, Failures: 0, Errors: 1

          ----------------

          Touches the following files:

          M java/engine/org/apache/derby/loc/messages.xml
          M java/shared/org/apache/derby/shared/common/reference/SQLState.java
          M java/client/org/apache/derby/client/net/Request.java

          Show
          Rick Hillegas added a comment - Attaching a second rev of this initial patch, derby-4315-01-ab-regularizeExceptionHandling.diff. The tests ran cleanly except for a suspicious error in NetworkServerMBeanTest. I have revamped the patch to improve error messages for the cases touched by this patch. I will re-run the tests. The error messages no longer falsely claim that a protocol error occurred. In addition, I tried to clarify the description of how the client driver recovers from the exception. This is the suspicious error I saw in NetworkServerMBeanTest. When I ran the test standalone, I saw no errors. However, we know from past experience that NetworkServerMBeanTest is sensitive to interference from tests which run before it: 1) testAttributeAccumulatedConnectionCount(org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest)java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: org.apache.derby:type=NetworkServer,system=c013800d-012c-658f-2b31-ffffe1d7aa3e at java.security.AccessController.doPrivileged(Native Method) at org.apache.derbyTesting.functionTests.tests.management.MBeanTest.getAttribute(MBeanTest.java:379) at org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest.testAttributeAccumulatedConnectionCount(NetworkServerMBeanTest.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.extensions.TestSetup.run(TestSetup.java:25) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.extensions.TestSetup.run(TestSetup.java:25) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:21) at junit.extensions.TestSetup.run(TestSetup.java:25) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) Caused by: javax.management.InstanceNotFoundException: org.apache.derby:type=NetworkServer,system=c013800d-012c-658f-2b31-ffffe1d7aa3e at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:627) at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:659) at org.apache.derbyTesting.functionTests.tests.management.MBeanTest$4.run(MBeanTest.java:382) ... 41 more FAILURES!!! Tests run: 8871, Failures: 0, Errors: 1 ---------------- Touches the following files: M java/engine/org/apache/derby/loc/messages.xml M java/shared/org/apache/derby/shared/common/reference/SQLState.java M java/client/org/apache/derby/client/net/Request.java
          Hide
          Rick Hillegas added a comment -

          Tests passed cleanly for me on derby-4315-01-ab-regularizeExceptionHandling.diff except for the ping test which regularly fails on mac os x.

          Show
          Rick Hillegas added a comment - Tests passed cleanly for me on derby-4315-01-ab-regularizeExceptionHandling.diff except for the ping test which regularly fails on mac os x.
          Hide
          Rick Hillegas added a comment -

          Committed derby-4315-01-ab-regularizeExceptionHandling.diff at subversion revision 1037716.

          Show
          Rick Hillegas added a comment - Committed derby-4315-01-ab-regularizeExceptionHandling.diff at subversion revision 1037716.
          Hide
          Rick Hillegas added a comment -

          Attaching derby-4315-02-aa-cleanupEndOfStreamMessage.diff. This patch cleans up the error reporting in the case when the InputStream at the client has fewer bytes than expected. The message no longer says that there is a protocol error. Running tests now.

          Touches the following file:

          M java/engine/org/apache/derby/loc/messages.xml

          Show
          Rick Hillegas added a comment - Attaching derby-4315-02-aa-cleanupEndOfStreamMessage.diff. This patch cleans up the error reporting in the case when the InputStream at the client has fewer bytes than expected. The message no longer says that there is a protocol error. Running tests now. Touches the following file: M java/engine/org/apache/derby/loc/messages.xml
          Hide
          Rick Hillegas added a comment -

          Committed derby-4315-02-aa-cleanupEndOfStreamMessage.diff at subversion revision 1037764. The tests passed cleanly for me although I did see the following exception on the console while running the JUnit tests:

          Exception in thread "DRDAConnThread_508" org.apache.derby.iapi.error.ShutdownException:
          at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(ContextManager.java:437)
          at org.apache.derby.iapi.services.context.ContextManager.getContext(ContextManager.java:155)
          at org.apache.derby.iapi.services.context.ContextService.getContextOrNull(ContextService.java:249)
          at org.apache.derby.iapi.util.InterruptStatus.restoreIntrFlagIfSeen(InterruptStatus.java:158)
          at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:356)
          at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
          at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
          at org.apache.derby.impl.jdbc.EmbedPreparedStatement.closeActions(EmbedPreparedStatement.java:261)
          at org.apache.derby.impl.jdbc.EmbedStatement.close(EmbedStatement.java:307)
          at org.apache.derby.impl.drda.DRDAStatement.close(DRDAStatement.java:1027)
          at org.apache.derby.impl.drda.Database.close(Database.java:364)
          at org.apache.derby.impl.drda.Session.close(Session.java:115)
          at org.apache.derby.impl.drda.DRDAConnThread.closeSession(DRDAConnThread.java:8289)
          at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:315)

          Show
          Rick Hillegas added a comment - Committed derby-4315-02-aa-cleanupEndOfStreamMessage.diff at subversion revision 1037764. The tests passed cleanly for me although I did see the following exception on the console while running the JUnit tests: Exception in thread "DRDAConnThread_508" org.apache.derby.iapi.error.ShutdownException: at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(ContextManager.java:437) at org.apache.derby.iapi.services.context.ContextManager.getContext(ContextManager.java:155) at org.apache.derby.iapi.services.context.ContextService.getContextOrNull(ContextService.java:249) at org.apache.derby.iapi.util.InterruptStatus.restoreIntrFlagIfSeen(InterruptStatus.java:158) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:356) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.closeActions(EmbedPreparedStatement.java:261) at org.apache.derby.impl.jdbc.EmbedStatement.close(EmbedStatement.java:307) at org.apache.derby.impl.drda.DRDAStatement.close(DRDAStatement.java:1027) at org.apache.derby.impl.drda.Database.close(Database.java:364) at org.apache.derby.impl.drda.Session.close(Session.java:115) at org.apache.derby.impl.drda.DRDAConnThread.closeSession(DRDAConnThread.java:8289) at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:315)
          Hide
          Rick Hillegas added a comment -

          Ported 1037716 from trunk to 10.7 branch at subversion revision 1037776.

          Ported 1037764 from trunk to 10.7 branch at subversion revision 1037777.

          Show
          Rick Hillegas added a comment - Ported 1037716 from trunk to 10.7 branch at subversion revision 1037776. Ported 1037764 from trunk to 10.7 branch at subversion revision 1037777.
          Hide
          Rick Hillegas added a comment -

          I believe that both parts of this bug have been addressed now. The bad row is not being inserted anymore and the EOF error no longer asserts that there was a protocol error.

          Show
          Rick Hillegas added a comment - I believe that both parts of this bug have been addressed now. The bad row is not being inserted anymore and the EOF error no longer asserts that there was a protocol error.
          Hide
          Kathey Marsden added a comment -

          Reopen for backport.

          Show
          Kathey Marsden added a comment - Reopen for backport.
          Hide
          Kathey Marsden added a comment -

          While the commit with this issue merges cleanly to 10.5, it is I think a patch to regularize the exception handling between server and client. Since it changes the SQLState, I don't think it is such a good candidate for backport. The actual fix is with DERBY-2017 which looks too hairy to me if not impossible to backport to 10.5 as it makes some protocol changes that might be problematic with mixed version, but I have not looked that closely. I think I will take this one off the backport list. I am thinking I should introduce a label for tracking issues that have been considered and then rejected for backport. I will send a separate mail to derby-dev for that.

          Show
          Kathey Marsden added a comment - While the commit with this issue merges cleanly to 10.5, it is I think a patch to regularize the exception handling between server and client. Since it changes the SQLState, I don't think it is such a good candidate for backport. The actual fix is with DERBY-2017 which looks too hairy to me if not impossible to backport to 10.5 as it makes some protocol changes that might be problematic with mixed version, but I have not looked that closely. I think I will take this one off the backport list. I am thinking I should introduce a label for tracking issues that have been considered and then rejected for backport. I will send a separate mail to derby-dev for that.
          Hide
          Kathey Marsden added a comment -

          Resolve issue. Decided against backport.

          Show
          Kathey Marsden added a comment - Resolve issue. Decided against backport.
          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:
              Rick Hillegas
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development