Re: Prefetching and iterated queries

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Oct 05 2009 - 08:33:37 EDT

  • Next message: Emanuele Maiarelli: "question about 3.0"

    You may try "joint prefetching" :

    http://cayenne.apache.org/doc20/prefetching.html

    This should let the query go through, and the data rows that you get
    back will contain data for the joined entity. There are a few caveats
    though:

    * Cayenne 2.0 uses INNER joins for joint prefetching, potentially
    reducing the number of rows in the result. 3.0 correctly uses OUTER
    joins, and generally has better prefetching support.

    * DataContext.objectFromDataRow(..) will not take prefetching into
    account, and will only instantiate the root entity. There's no
    workaround (even in 3.0) other than working with data rows without
    turning them into objects.

    Andrus

    On Oct 5, 2009, at 10:00 AM, Mark Fraser wrote:

    > Using version 2.0.4....
    >
    > Is it possible to use prefetching with iterated queries (or to
    > otherwise achieve the same effect)?
    >
    > I added prefetches to my iterated query and got the runtime excpetion:
    >
    > "Iterated queries are not allowed in a batch."
    >
    > I don't get this error when I don't add the prefetches so I guess
    > what I'm really asking is is there a way to achieve prefetching with
    > iterated queries?
    >
    > Thanks
    >



    This archive was generated by hypermail 2.0.0 : Mon Oct 05 2009 - 08:35:06 EDT