Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-23

[dbcp] SQLException When PoolablePreparedStatement Already Closed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.3
    • None
    • Operating System: All
      Platform: All

    • 32441

    Description

      When closing an already closed
      org.apache.commons.dbcp.PoolablePreparedStatement, a SQLException is thrown when
      the isClosed() method returns true.

      This seems to violate the contract of java.sql.Statement (super interface of
      implemented PreparedStatement) whose javadoc reads " Calling the method close on
      a Statement object that is already closed has no effect."

      Work around exists – when ever closing a statement, also null out. Then,
      before closing, check that it's non-null.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--issue32441.patch
          0.5 kB
          Jacob Zwiers
        2. patch.txt
          1 kB
          Akom

        Activity

          People

            Unassigned Unassigned
            apache_bugzilla@zwiers.ca Jacob Zwiers
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: