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

[dbcp] Dbcp doesn't meet JDBC specification

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2
    • 2.0
    • None
    • Operating System: other
      Platform: All

    • 31569

    Description

      The JDBC specification says for ResultSet and Statement that the ResultSet and
      Statement will be automatically closed when garbage collected.

      This means that people often write code like this

      Connection.getStatement().executeSQL("....");

      However, because the DelegateConnection/DelegateStatement/DelegateResultSet
      extend AbandonedTrace (and are linked into the abandoned trace mechanism) they
      will not be garbage collected until the connection is closed.

      This of course means that DBCP holds on to lots of memory that it shouldn't do
      (I've had people complain to me of memory leaks).

      Surely it's possible to make the DelegateXX hold onto something else which does
      the AbandonedTrace and so when it is released it can do the implicit close and
      then everything will be coool.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            rlenard Rohan Lenard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment