[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2255) Provide way around DB limitation for large "where x in (...)"

Gerald Glocker (JIRA) noreply at atlassian.com
Mon Nov 20 05:36:05 EST 2006


Provide way around DB limitation for large "where x in (...)"
-------------------------------------------------------------

         Key: HHH-2255
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2255
     Project: Hibernate3
        Type: Improvement

  Components: query-hql, query-criteria, core  
    Versions: 3.2.1    
    Reporter: Gerald Glocker


In-Restrictions with a large number of elements lead to database sql errors (e.g. ORA-01795 in Oracle).

This issue came up on Hbernate 2 earlier (HB-655) but wasn't fixed for unknwon reasons.

The maximum IN list size in Oracle is 1000. Other DBs may also have similar limitations.

To work around these DB limits, large In-Restrictions in HQL/Criteria could be split into multiple In-Restrictions combined as disjunction:

     x in (1,2,3,4...)

could be split into:

     (x in (1,2,3,4,...)
or (x in (1001,1002,1003,....)

Shoul also be done for composite-values: "(x, y) in ((1,1), (1,2), (1,3), ...)"

-- 
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