a...bug with pgsql and addPrefetch? (Cay 1.2B2)

From: Tomi NA (hefes..mail.com)
Date: Thu May 11 2006 - 11:14:27 EDT

  • Next message: Alan Baltazar: "Re: cayenne+jasperreports problem"

    I have a table with 50-100 thousand records which I want to search on
    a find-as-you-type basis.
    This is what was executed when a key was pressed:

            results = new ArrayList();
            List<MyRec> myRecs = null;

            String[] searchKeys = dissassemble(pattern);
            SelectQuery query = prepQuery(searchKeys);
            query.addPrefetch(MyRec.TO_OTHER_REC_PROPERTY);
            query.setFetchLimit(100);
            myRecs = myContext.performQuery(query);
            for (MyRec mr : myRecs) {
                results.add(mr.getToOtherRec());
            }

    Now, what happens is that 2 queries are run. The first is limited to
    100, just the way I wanted it. The second, however, is not: it will
    return 50k records no questions asked.

    I can work arround the problem just by not doing the prefetch: then
    everything works i.e. my app doesn't break down due to an
    OutOfMemoryException.
    If I missunderstood the intended behaviour of addPrefetch, someone
    please correct me. Otherwise, I'll proceed to submiting a bug
    report...

    Tomislav



    This archive was generated by hypermail 2.0.0 : Thu May 11 2006 - 11:14:52 EDT