[ 
https://issues.apache.org/jira/browse/DBCP-221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768151#action_12768151
 ] 

Roshan Gunasekara commented on DBCP-221:
----------------------------------------

I agree with the change of behaviour of close() so that its permanently closed. 

However we relied on the current behaviour as a way of restarting the 
Connection Pool after changing its properties without a full JVM restart. (e.g. 
change the Database URL). I agree this is a hack and there is no guarantee it 
will continue to work. 

But I think you might agree, is a useful feature to have. Looking at the source 
code, I spotted a restart() method which is currently private and not used, 
which just calls close(). 

Will it make sense to expose this method and have an overloaded method 
close(boolean permanent) which controls if its a permanent close or not. 

If you agree, I am happy to submit a patch. 











> How to close the connection pool without shutting down the JVM while there 
> are connections being used?
> ------------------------------------------------------------------------------------------------------
>
>                 Key: DBCP-221
>                 URL: https://issues.apache.org/jira/browse/DBCP-221
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Bill Liu
>            Assignee: Dain Sundstrom
>             Fix For: 1.3
>
>
> Suppose there are several connections being used now by different servlets. 
> calling the basicDataSource,close() does not have any impact on the 
> connection pool. I expect that after these servlet return the connections the 
> pool should be shut down immediately. I also expect that any more requests to 
> borrow connections from the pool should not be fulfilled. However, my 
> experiment does not seem to support my expectations. Calling 
> basicDataSource.close() seems to be ignored while there are connections being 
> used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to