I think this is more a limitation of the current prefetch behavior,
than an actual bug. You may want to experiment with the prefetch
"advice", or semantics:
http://objectstyle.org/confluence/display/CAYDOC/Prefetching
I'm assuming you're using 1.2 latest release, of course. If you're
using something that's not 1.1 latest or 1.2 latest, then it will be
hard to talk about it. Anyway, if the docs don't provide any helpful
info, please post the debugging output - specifically, the queries
that are executed in this case.
Cris
On 5/11/06, Tomi NA <[EMAIL PROTECTED]> wrote:
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