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

Description

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), ...)"

Activity

Show:

Former user December 11, 2017 at 11:25 AM

it's fixed by as I can see

Duplicate

Details

Assignee

Reporter

Components

Priority

Created November 20, 2006 at 12:34 PM
Updated November 2, 2021 at 9:48 AM
Resolved November 2, 2021 at 9:48 AM