Class ScrollInsensitiveResultSet

All Implemented Interfaces:
CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource

public class ScrollInsensitiveResultSet extends NoPutResultSetImpl implements CursorResultSet
Provide insensitive scrolling functionality for the underlying result set. We build a disk backed hash table of rows as the user scrolls forward, with the position as the key. For read-only result sets the hash table will containg the following columns:
  +-------------------------------+
  | KEY                           |
  +-------------------------------+
  | Row                           |
  +-------------------------------+
where key is the position of the row in the result set and row is the data. And for updatable result sets it will contain:
  +-------------------------------+
  | KEY                           | [0]
  +-------------------------------+
  | RowLocation                   | [POS_ROWLOCATION]
  +-------------------------------+
  | Deleted                       | [POS_ROWDELETED]
  +-------------------------------+
  | Updated                       | [POS_ROWUPDATED]
  +-------------------------------+
  | Row                           | [extraColumns ... n]
  +-------------------------------+
where key is the position of the row in the result set, rowLocation is the row location of that row in the Heap, Deleted indicates whether the row has been deleted, Updated indicates whether the row has been updated, and row is the data.
  • Field Details

    • source

      public NoPutResultSet source
    • sourceRowWidth

      private int sourceRowWidth
    • ht

    • resultRow

      private ExecRow resultRow
    • positionInSource

      private int positionInSource
    • currentPosition

      private int currentPosition
    • lastPosition

      private int lastPosition
    • seenFirst

      private boolean seenFirst
    • seenLast

      private boolean seenLast
    • beforeFirst

      private boolean beforeFirst
    • afterLast

      private boolean afterLast
    • numFromHashTable

      public int numFromHashTable
    • numToHashTable

      public int numToHashTable
    • maxRows

      private long maxRows
    • keepAfterCommit

      private boolean keepAfterCommit
    • extraColumns

      private int extraColumns
    • positionInHashTable

      private SQLInteger positionInHashTable
    • target

      private CursorResultSet target
    • needsRepositioning

      private boolean needsRepositioning
    • POS_ROWLOCATION

      private static final int POS_ROWLOCATION
      See Also:
    • POS_ROWDELETED

      private static final int POS_ROWDELETED
      See Also:
    • POS_ROWUPDATED

      private static final int POS_ROWUPDATED
      See Also:
    • LAST_EXTRA_COLUMN

      private static final int LAST_EXTRA_COLUMN
      See Also:
  • Constructor Details

    • ScrollInsensitiveResultSet

      public ScrollInsensitiveResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, int sourceRowWidth, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException
      Constructor for a ScrollInsensitiveResultSet
      Parameters:
      source - The NoPutResultSet from which to get rows to scroll through
      activation - The activation for this execution
      resultSetNumber - The resultSetNumber
      sourceRowWidth - # of columns in the source row
      Throws:
      StandardException - on error
  • Method Details