ObjectDB is throwing an InternalException in JdoQuery:
Caused by: com.objectdb.o.InternalException at com.objectdb.o.BYR.s(BYR.java:113) at com.objectdb.o.BYR.A(BYR.java:206) at com.objectdb.o.VUT.j(VUT.java:346) at com.objectdb.o.ACN.UX(ACN.java:162) at com.objectdb.o.RTT.H(RTT.java:282) at com.objectdb.o.RST.C(RST.java:183) at com.objectdb.o.RTT.l(RTT.java:134) at com.objectdb.o.RST.l(RST.java:24) at com.objectdb.o.RTT.D(RTT.java:179) at com.objectdb.o.RST.s(RST.java:121) at com.objectdb.o.PGT.q(PGT.java:109) at com.objectdb.o.RST.B(RST.java:93) at com.objectdb.o.RTT.l(RTT.java:132) at com.objectdb.o.RST.l(RST.java:24) at com.objectdb.o.RTT.D(RTT.java:179) at com.objectdb.o.RST.s(RST.java:121) at com.objectdb.o.PGT.q(PGT.java:109) at com.objectdb.o.RST.B(RST.java:93) at com.objectdb.o.RTT.l(RTT.java:132) at com.objectdb.o.RST.l(RST.java:24) at com.objectdb.o.TSK.i(TSK.java:146) at com.objectdb.o.TSK.f(TSK.java:95) at com.objectdb.o.MST.aV(MST.java:568) at com.objectdb.o.MST.U4(MST.java:527) at com.objectdb.o.BTP.U4(BTP.java:588) at com.objectdb.o.TAI.A(TAI.java:200) at com.objectdb.o.TAI.Uu(TAI.java:134) at com.objectdb.o.PRG.ag(PRG.java:679) at com.objectdb.o.PRG.af(PRG.java:553) at com.objectdb.o.QRM.U6(QRM.java:264) at com.objectdb.o.MST.U6(MST.java:933) at com.objectdb.o.WRA.U6(WRA.java:293) at com.objectdb.o.WSM.U6(WSM.java:113) at com.objectdb.o.QRR.g(QRR.java:244) at com.objectdb.o.QRR.f(QRR.java:153) at com.objectdb.jdo.JdoQuery.execute0(JdoQuery.java:811) at com.objectdb.jdo.JdoQuery.execute(JdoQuery.java:732)
This happens in the specific case when:
- A query filter like this is used: ":ids.contains(originalId)"
- originalId is an indexed String field on the candidate class
- :ids is a list which contains a duplicate entry
If the field is unindexed, or :ids does not contain duplicates, the exception is not thrown and the query produces the expected results.
An easy workaround is to copy the list values into a set and then pass that to Query.execute() instead.