[Opensource] dbconn pool disconnect
larry hamel
expresso at codeguild.com
Sat Jan 18 12:53:54 PST 2003
Pierre,
sorry, I can't follow this in current code.
larry
At 04:46 AM 1/6/2003, you wrote:
>in DBConnectionPool line 384 and ... we find
>
> vecConnectionsToBeRemoved.addElement(new Integer(oneConnection.getId()));
>
> oneConnection.disconnect();
> oneConnection.setAvailable(false);
> }
> } /* for each connection in the pool */
>
> /* Now iterate that vector and remove the connection objects from the hashmap
> This is done to avoid the ConcurrentModificationException*/
> if(bCheckToRemove){
> for(int i=0; i<vecConnectionsToBeRemoved.size(); i++){
> DBConnection dbconn = (DBConnection)vecConnectionsToBeRemoved.elementAt(i);
> oneConnection.disconnect();
> oneConnection.setAvailable(false);
> inUse.remove(new Integer(oneConnection.getId()));
> }
>
>You store connection to close as an Integer (its ID), but you retreive it as DBConnection : conclusion CastException.
>Also, you disconnect and setAvailable(false) twice. I propose
>
> vecConnectionsToBeRemoved.addElement(oneConnection);
> }
> } /* for each connection in the pool */
>
> /* Now iterate that vector and remove the connection objects from the hashmap
> This is done to avoid the ConcurrentModificationException*/
> if(bCheckToRemove){
> for(int i=0; i<vecConnectionsToBeRemoved.size(); i++){
> DBConnection dbconn = (DBConnection)vecConnectionsToBeRemoved.elementAt(i);
> oneConnection.disconnect();
> oneConnection.setAvailable(false);
> inUse.remove(new Integer(oneConnection.getId()));
> }
>
>PMX
>
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list