commons-dev mailing list archives

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


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 ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message