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

Emmanuel Bernard (JIRA) noreply at atlassian.com
Mon Dec 18 13:06:04 EST 2006


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

Emmanuel Bernard commented on HB-655:
-------------------------------------

the query parser of HB 2 was a PITA to maintain

> 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