Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-707

providing RowLocation for deleted+purged row to GenericConglomerateController causes nullpointerexception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 10.2.1.6
    • Store
    • None
    • Java 1.4

    Description

      To provide scrollable updatable resultsets, we will store the RowLocation for every row in the ResultSet in a temporary table (backingstore hashtable). The RowLocation is used to reposition the cursor before an update.

      The problem is when the row for the RowLocation has been deleted and purged by another transaction. The update will then fail with a NullPointerException in GenericConglomerateController.replace(..):

      java.lang.NullPointerException
      at org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController.replace(GenericConglomerateController.java:465)
      at org.apache.derby.impl.sql.execute.RowChangerImpl.updateRow(RowChangerImpl.java:516)
      at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(UpdateResultSet.java:577)
      at org.apache.derby.impl.sql.execute.UpdateResultSet.open(UpdateResultSet.java:276)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:368)
      at org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3256)

      It fails when checking if the row has been deleted (not purged) , because pos.current_page is null:

      if (pos.current_page.isDeletedAtSlot(pos.current_slot))

      { ret_val = false; }

      The proposed fix is to use the return value from open_conglom.latchPage(..). If it returns false, the RowLocation is invalid (deleted+purged).

      Attachments

        1. DERBY-707.stat
          0.2 kB
          Andreas Korneliussen
        2. DERBY-707.diff
          5 kB
          Andreas Korneliussen

        Activity

          People

            andreask Andreas Korneliussen
            andreask Andreas Korneliussen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: