Uploaded image for project: 'Commons DbUtils'
  1. Commons DbUtils
  2. DBUTILS-143

Don't close connection if provided

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6, 1.7
    • 1.8.0
    • None

    Description

      Private methods in QueryRunner (e.g. batch, query, insert, update) that are passed a connection rather than creating it should not close that connection.

      Since the connection does not originate in those methods, it shouldn't be considered the owner of the connection and therefore shouldn't close it on behalf of the caller.

      There are a few convenience methods that create connection using `prepareConnection()`. These should use try-with-resources to handle the connection.

      Attachments

        Activity

          People

            thecarlhall Carl Franklin Hall
            thecarlhall Carl Franklin Hall
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: