commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (DBCP-312) BasicDataSource.close() method needs JavaDoc clarification
Date Mon, 25 Apr 2011 17:21:03 GMT

     [ https://issues.apache.org/jira/browse/DBCP-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Phil Steitz reopened DBCP-312:
------------------------------


Reopening just to change fix version.

> BasicDataSource.close() method needs JavaDoc clarification
> ----------------------------------------------------------
>
>                 Key: DBCP-312
>                 URL: https://issues.apache.org/jira/browse/DBCP-312
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Glen Mazza
>            Priority: Minor
>             Fix For: 1.4.1
>
>
> Hello, the JavaDoc could use clarification for the BasicDataSource.close() method.  
> Link:  http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html#close()
> Text: "Close and release all connections that are currently stored in the connection
pool associated with our data source. All open (active) connection remain open until closed.
Once the data source has been closed, no more connections can be obtained."
> I'm unsure if this method closes just idle, or both idle and active connections.  This
is a important distinction, because you wouldn't want to call close() if you still have some
needed active connections open on various threads.  The first sentence seems to indicate both
active and idle threads will be closed, but the second sentence indicates that only the idle
threads will be explicitly closed.
> Recommend changing text to:
> "Close and release all connections, whether active or idle, that are currently stored
in the connection pool associated with our data source.  Once the data source has been closed,
no more connections can be obtained."
> or (if this method closes just idle connections):
> "Close and release all idle connections that are currently stored in the connection pool
associated with our data source. All open (active) connections will still remain open until
they are closed via the Connection close() method. Once the data source has been closed, no
more connections can be obtained."
> Note that, for the latter case, if BasicDataSource.close() only closes and releases idle
connections, and an active DBCP Connection object subsequently has its close() method called,
it's not clear whether its underlying actual JDBC connection will be released.  I.e., how
do you release JDBC connections on previously active DBCP Connections after BasicDataSource.close()
is called?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message