commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: Potential issue in commons dbcp
Date Thu, 26 Feb 2004 19:10:48 GMT
Excellent, good analysis and even a patch.

Any chance you could write a JUnit test ;-)

Thanks
Dirk

Ludovic Dubost wrote:
> I posted it in apache's bugzilla
> 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27246
> 
> Ludovic
> 
> Ludovic Dubost wrote:
> 
>>
>> Hi,
>>
>> I think I found a potential problem in commons dbcp and can't find 
>> where I should report it..
>> If you use the setCatalog function of JDBC you have an issue with the 
>> Prepared Statement Cache, since the cache considers that two 
>> statements with different catalogs are the same, and therefore returns 
>> wrong data..
>>
>> My reproduction of the problem is:
>>
>> 0/ setup two databases (in my case it is mysql) with the same table 
>> with different a different amount of lines in the table
>> 1/ open a connection
>> 2/ run a query to count number of lines of the table
>> 3/ switch databases using setCatalog
>> 4/ run the same query
>> 5/ you get the same result as before (the result from the 1st database)
>>
>> Now if you do it the other way around, then you get the result from 
>> the second database..
>> I believe the problem can only come from the prepared statement cache..
>>
>> Any thoughts ?
>> Ludovic



---------------------------------------------------------------------
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