-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: SQLQuery IN Clause "ignores" large number of params
PostPosted: Thu Dec 02, 2010 7:28 am 
Newbie

Joined: Thu Dec 02, 2010 7:10 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.