Object Caching

From: Hans Pikkemaat (h.pikkemaa..si-solutions.nl)
Date: Wed Nov 11 2009 - 08:43:51 EST

  • Next message: Hans Pikkemaat: "Re: complex query vs performIteratedQuery vs Prefetching"

    Hi,

    I use the latest version of cayenne, 3.0b and am experimenting with the
    object caching features.

    The documentation states that committed objects are purged from the
    cache because it uses weak references.
    (http://cayenne.apache.org/doc/individual-object-caching.html)

    If I however run a query using SQLTemplate which caches the objects into
    the dataContext local cache (objectstore),
    the objects don't seem to be purged at all. If I simply run the query
    dump the contents using an iterator on the resulting
    List then the nr of registered objects in the objectstore stays the same
    (dataContext.getObjectStore().registeredObjectsCount()).
    Even if I manually run System.gc() I don't see any changes (I know this
    can be normal as gc() doesn't guarantee anything)

    What am I doing wrong? Under which circumstances will cayenne purge the
    cache?

    tx

    Hans



    This archive was generated by hypermail 2.0.0 : Wed Nov 11 2009 - 08:44:37 EST