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

Add mention that Derby supports rowUpdated, rowDeleted with a result set concurrency of CONCUR_READ_ONLY

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.2.1.6, 10.2.2.0, 10.3.1.4
    • 10.3.2.1, 10.4.1.3
    • Documentation
    • None
    • Normal

    Description

      We should add a note on the behavior on the rowXXX methods in
      java.sql.ResultSet, since they now (as of JDBC 4.0) have an optional
      feature.

      Cf this "Note:" for rowDeleted in JDBC4 API:

      > boolean rowDeleted() throws SQLException
      >
      > Retrieves whether a row has been deleted. A deleted row may leave a
      > visible "hole" in a result set. This method can be used to detect
      > holes in a result set. The value returned depends on whether or not
      > this ResultSet object can detect deletions.
      >
      > Note: Support for the rowDeleted method is optional with a result set
      > concurrency of CONCUR_READ_ONLY
      >
      > Returns:
      > true if the current row is detected to have been deleted
      > by the owner or another; false otherwise
      > Throws:
      > SQLException - if a database access error occurs or this
      > method is called on a closed result set
      >
      > SQLFeatureNotSupportedException - if the JDBC driver does
      > not support this method
      > Since:
      > 1.2
      > See Also:
      > DatabaseMetaData.deletesAreDetected(int)

      For updatable result sets, Derby supports calling the methods
      rowDeleted, rowUpdated and rowInserted even if the RS had concurrency
      CONCUR_READ_ONLY. If the query's underlying result set if scrollable
      and updatable, rowUpdated and rowDeleted can be used to detect if
      changes were made using positioned UPDATE/DELETEs, since positioned
      modifications are seen by the result set in Derby. Normally, though,
      such usage is not recommended. If updates are required, the RS should
      have concurrency CONCUR_UPDATABLE.

      rowInserted will always return false, since Derby does not detect
      inserts.

      Attachments

        1. DERBY-1769.zip
          5 kB
          Dag H. Wanvik
        2. DERBY-1769.stat
          0.1 kB
          Dag H. Wanvik
        3. DERBY-1769.diff
          3 kB
          Dag H. Wanvik

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dagw Dag H. Wanvik
            dagw Dag H. Wanvik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment