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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to