You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Carl Franklin Hall (Jira)" <ji...@apache.org> on 2020/01/09 06:02:00 UTC
[jira] [Created] (DBUTILS-143) Don't close connection if provided
Carl Franklin Hall created DBUTILS-143:
------------------------------------------
Summary: Don't close connection if provided
Key: DBUTILS-143
URL: https://issues.apache.org/jira/browse/DBUTILS-143
Project: Commons DbUtils
Issue Type: Bug
Affects Versions: 1.7, 1.6
Reporter: Carl Franklin Hall
Assignee: Carl Franklin Hall
Fix For: 1.8
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)