commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18905] - Couldn't get connection (Jdbc2PoolDataSource)
Date Sun, 13 Apr 2003 23:00:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18905>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18905

Couldn't get connection (Jdbc2PoolDataSource)





------- Additional Comments From mohankishore@yahoo.com  2003-04-13 23:00 -------
The Jdbc2PoolDataSource class uses the GenericKeyedObjectPool (in turn backed 
by KeyedCPDSConnectionFactory) to get the connections when a 
ConnectionPoolDataSource is used (i.e. as opposed to the case when the 
DataSourceName is used to fetch from JNDI).

In this case, the Jdbc2PoolDataSource create a UserPassKey based on the 
username and password. But surprisingly, the equals() method in this class only 
considers the username.

Hence, if the initial login (with a particular username) is wrong, all 
subsequent login attempts with that username keep failing - as the correponding 
passwords are totally ignored.

On the other hand, if the first login succeeds, all subsequent logins with the 
same username succeed TO A POINT. After getting a connection, the code checks 
to see that the new supplied password is the same as the old cached one, and 
throws an exception if not.

The fix would be to include the password in equals() method. And to ensure that 
the getUserPassKey() method returns the correct object...

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message