[M7 Preview] Caching Query Results

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jun 07 2004 - 14:04:18 EDT

  • Next message: jir..bjectstyle.org: "[OS-JIRA] Created: (CAY-137) SELECT SYSDATE FROM DUAL"

    Just an FYI...

    While working on CAY-36
    (http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-36) I came
    up with a generic solution to cache query results. This can be used
    either for caching lookup tables, or for any other purpose.

     From now on Cayenne can cache query results either in a shared cache,
    or at a DataContext level. Cache is keyed using the query "name"
    property as a key. API:

    1. (SelectQuery|SQLTemplate).setCachePolicy(String policy)
    2. GenericSelectQuery.(LOCAL_CACHE|SHARED_CACHE|NO_CACHE)
    3. Refreshing of the cache is done by using an existing property:
    GenericSelectQuery.isRefreshingObjects()
    4. Calling a named query shortcut: DataContext.performQuery(String
    queryName, boolean refresh)

    CVS version of the Modeler already supports caching parameters.

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Jun 07 2004 - 14:04:25 EDT