commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ludovic Dubost <ludo...@pobox.com>
Subject Potential issue in commons dbcp
Date Thu, 26 Feb 2004 00:12:04 GMT

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