[Opensource] is a bug ?
pierre.damas at damas.be
pierre.damas at damas.be
Mon Jan 6 13:38:01 PST 2003
And also, you retrieve the connection in the variable dbconn, and call the
methods on the previous oneConnection variable (cut and paste error,
probably...)
I propose:
DBConnection dbconn =
(DBConnection)vecConnectionsToBeRemoved.elementAt(i);
dbconn.disconnect();
dbconn.setAvailable(false);
inUse.remove(new Integer(dbconn.getId()));
Pierre A.
----- Original Message -----
From: "Pierre Mergaux" <pmergaux at noos.fr>
To: "jCorporate Expresso project" <opensource at jcorporate.com>
Sent: Monday, January 06, 2003 1:46 PM
Subject: [Opensource] is a bug ?
> 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