We are running a SQLQuery with large number of parameters like this:
Code:
String queryString = "SELECT FROM VIEW1, TABLE1...(several tables joined) where
VIEW1.column1 IN (?....?)";
//values is the Array of Long parameters.
SQLQuery sqlQuery = session.createSQLQuery(queryString);
if (values != null) {
for (int i = 0; i < values.length; i++) {
sqlQuery.setParameter(i, values[i]);
}
}
This SQLQuery object returns correct results list when the IN Clause has 220-250 parameters. If the number of parameters is large, like 490, 790, etc, the query just ignores several parameters that have values and returns results only for some parameters. Based on several test cases we found that it returns results only for a maximum of 256 IN parameters. The rest of the parameters are just ignored. We are not getting any errors, just missed data.
I also manually checked the data to ensure when we run the same SQLQuery for lesser number of parameters like 20, 30 etc, the results list comes fine.
We are using Hibernate 3.jar (version 3.2.4 ga), with Oracle 10g.
I am facing the same issue in both Weblogic on UNIX and jboss-4.2.0-Windows XP.
Please help/advise how to troubleshoot.