commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haixi Liu (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DBCP-61) [dbcp] Individual connection close method
Date Wed, 21 Oct 2009 20:48:59 GMT

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

Haixi Liu commented on DBCP-61:
-------------------------------

Mark,

I am a colleague of Srinath's and I tested the patch for DBCP-8 and it didn't resolve our
problem.

I then looked in the source code and found that the solution would only work for SharedPoolDataSource
and not PerUserPoolDataSource because the related changes are only made to SharedPoolDataSource
and we are using PerUserPoolDataSource.

Can the same fix for DBCP-8 be extended to cover PerUserPoolDataSource? If not, then we probably
will still need a solution around the close method as proposed in this bug report.

Thanks,
Haixi

> [dbcp] Individual connection close method
> -----------------------------------------
>
>                 Key: DBCP-61
>                 URL: https://issues.apache.org/jira/browse/DBCP-61
>             Project: Commons Dbcp
>          Issue Type: Bug
>         Environment: Operating System: Windows XP
> Platform: PC
>            Reporter: Srinath Narasimhan
>            Assignee: Phil Steitz
>             Fix For: 1.3
>
>
> The PerUserPoolDataSource object has a close method which closes all the 
> connection that is being maintained by the pool. I have a need where the users 
> can change their passwords, which requires closing the existing connection and 
> opening a new one. I have a close method which takes a user as a parameter 
> which will close all the connections for the specified user name.
> I have pasted the code here.
>     /**
>      * Close pool for particular user
>      * 
>      */
>     public void close(String user) {
>     	try {
>             PoolKey key = getPoolKey(user);
>             ObjectPool pool = (ObjectPool) pools.get(key);
>             pool.close();
>     	} catch (Exception closePoolException) {
>     		closePoolException.printStackTrace();
>     	} 
>     }
> My questions are are is this is a right way to approach or should there a 
> change password method which should do that ? If the above code can be added 
> to the main stream ( if it is good, it will be great). 
> Thanks.

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


Mime
View raw message