Open alkuma opened 4 years ago
We are experiencing this as well. It seems that it doesn't pay attention to the catalog that the prepared statement is tied to, so when you create the preparedstatement after you change the catalog, it doesn't create a new one to reflect the new catalog, it just gives the last one with whatever catalog it happens to have.
Do you have PreparedStatement caching turned on? (Is maxStatements and/or maxStatementsPerConnection greater thann zero in your config?) Do you see the issue if statement caching is off (both maxStatements and maxStatementsPerConnection set to their defaults of zero)?
We are setting up a multitenant application with a single ms sqlserver database server having multiple databases, one per site.
c3p0 0.9.5.5
is being used for connection pooling.We do a
setCatalog()
call to set the database to use. In the example program we are using a simple "select a from test_table
" query. However after the second setCatalog() call, we start getting the error of this form:However with the same test query without c3p0 (directly acquiring a connection), we never face this issue. What are we doing wrong, or is there a known issue in c3p0 for this?