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

After commit, holdable result set cursor used in positioned update can't access row

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 10.2.1.6
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None

      Description

      Using the embedded driver, with autocommit off, and holdability for a
      updatable result set (HOLD_CURSORS_OVER_COMMIT), I first
      position on a row in the result set, and then commit the
      transaction. The result set should still be open since holdability is
      active. However, when accessing the result set using a named cursor
      in a subsequent "Positioned update" statement, Derby returns an error
      message: "Invalid cursor state - no current row" (SQLState 24000).

      Please see the self-contained repro case in the attachment for
      details.

      It appears the problem is related to reopening of holdable result sets
      after a commit. During normal use of result sets, the ResultSet#next()
      operation will make sure the result set is opened (after locks were
      released at commit time). Apparently no such reopening is performed in
      the "positioned update" case. (small detail: Note that in the
      "positioned update" case, the reopening is for accessing the current
      row (again), not the next - I am not sure if that matters, though).

        Attachments

        1. Main.java
          3 kB
          Dag H. Wanvik

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dagw Dag H. Wanvik
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: