Re: Query Caching (newbie)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu May 12 2005 - 23:09:32 EDT

  • Next message: Jürgen Saar: "Re: Generating XML tree representation of related database data"

    On May 12, 2005, at 6:35 PM, Jonathan Carlson wrote:
    > I'm just curious how "smart" Cayenne might be with caching queries.
    > What happens if two queries use the same name, yet have different
    > qualifiers? Will the second query just return the exact results that
    > the first query returned (ignoring the qualifiers and ordering on the
    > second query)?

    Cayenne is very simplistic about that. Queries are cached using String
    name just like the docs suggest.

    Such behavior (sort of intentionally) limits the use of this feature to
    caching semi-static reusable data sets like lookup tables and such. Any
    "smarter" algorithm can potentially become a memory hog and slow down
    object graph updates.

    Having said that, I think we should probably put some safeguards in
    place to avoid accidental results corruption, and expand the feature to
    maybe parameterized queries (so that each set of query parameters could
    be internally converted to a unique key), etc...

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu May 12 2005 - 23:09:34 EDT