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

Client setCharacterStream closes its Reader argument stream in finalizer

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0
    • Fix Version/s: 10.7.1.1
    • Component/s: Network Client
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Embedded/Client difference, Regression

      Description

      The javadoc for PreparedStatement.setCharacterStream does not specify that the stream passed in will be closed, only that it will read to the number of characters specified.
      For the embedded driver, the stream is not closed after execution; the client driver, however, will close the stream when the internal stream object EncodedInputStream is garbage collected, which can happen any time after the statement has been executed.
      I am not sure this a bug vs. the JDBC specification, but it would be nice to harmonize client and embedded behavior on this.

        Attachments

        1. derby-4531b.stat
          0.2 kB
          Dag H. Wanvik
        2. derby-4531b.diff
          3 kB
          Dag H. Wanvik
        3. derby-4531.diff
          0.5 kB
          Dag H. Wanvik
        4. derby-4531-1a-test_workaround.diff
          2 kB
          Kristian Waagan
        5. Repro.java
          14 kB
          Dag H. Wanvik

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: