[hibernate-issues] [Hibernate-JIRA] Commented: (HB-655) Oracle limitation: large "where x in (....)'

Ritesh (JIRA) noreply at atlassian.com
Mon Dec 11 07:09:05 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HB-655?page=comments#action_25609 ] 

Ritesh commented on HB-655:
---------------------------

Hi Emmanuel,
                      We have a similar issue where the no of elements in a criteria in clause is more then 1000. See that the issue status is Won't Fix.  IN that case possibly we will have to find a workaround in the code. But can you let us know why was it decided against fixing this issue and what were the possible concerns .

> Oracle limitation: large "where x in (....)'
> --------------------------------------------
>
>          Key: HB-655
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-655
>      Project: Hibernate2
>         Type: Improvement

>   Components: core
>     Versions: 2.1.1
>  Environment: Hibernate 2.1.1
> Oracle 8i
>     Reporter: Christian Gruber
>     Assignee: Emmanuel Bernard

>
>
> Hello!
> There is a problem with queries with named parameters that consist of big lists with Oracle. An example:
> Collection idList = new LinkedList();
> for (int i=0; i<1001; i++) {
>     idList.add(new Integer(i));
> }
> Query query = session.createQuery("from Geneticelem as geneticelem where geneticelem.id in (:ids)");
> query.setParameterList("ids", idList, Hibernate.INTEGER);
> Iterator geneticelems = query.iterate();
> This code results in an ORA-01795 exception, because not more than 1000 elements are allowed for "in".
> In OJB, this is solved by splitting the "in" condition is split up in chunks: http://db.apache.org/ojb/api/org/apache/ojb/broker/query/Criteria.html#addIn(java.lang.String,%20java.util.Collection)
> Can something like this also be implemented in Hibernate? I know, it's a limitation that will rarely be encountered, but still it's a limitation.
> Thanks,
> Christian

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list