Query#setRange DataNucleus implementation currently reads in every single row and stores as strongly referenced objects, including all rows before the range on DB2. We see Out of Memory.

Actually, DB2 SQL does support range, long time ago. Just for the only purpose of Proof of Concept, adding this into .rdbms.adapter.DB2Adapter seems working:
@Override
public String getRangeByRowNumberColumn()
{
return "row_number()over()";
}

Query#setRange DataNucleus implementation currently reads in every single row and stores as strongly referenced objects, including all rows before the range on DB2. We see Out of Memory.
Actually, DB2 SQL does support range, long time ago. Just for the only purpose of Proof of Concept, adding this into .rdbms.adapter.DB2Adapter seems working:
@Override
public String getRangeByRowNumberColumn()
{
return "row_number()over()";
}
This fix is required:
HTTP://WWW.DataNucleus.org/servlet/jira/browse/NUCRDBMS-433