I'm facing an OutOfMemoryException when trying to load a list of objects using OJB persistence broker. There are more than 20000 objects in the database (sybase). I have tried to limit the size of the returned list to 200. But the problem persists. Since OJB do not support paging, is there any solution to resolve this problem ?
PersistenceBroker broker= BrokerFactory.getBroker();
QueryByCriteria query = new QueryByCriteria( Fo.class, criteria);
query.setEndAtIndex(200);
Collection listFo= broker.getCollectionByQuery(query);