Re: DataObjectUtils.objectForPK() caches- is there a way to not use the cache on this one?

From: Cris Daniluk (cris.danilu..mail.com)
Date: Wed Dec 07 2005 - 08:57:41 EST

  • Next message: Mike Kienenberger: "Re: Handling of DATE and TIME values"

    Not to mention, caching is not necessarily related to data freshness.
    We dealt with external data changing the database with a simple
    trigger that would notify the webapp (via a "special url"). The webapp
    would invalidate all objects in that table (if it was even cached at
    all). Best of both worlds... great performance, current data. There
    are numerous other ways to do the same thing without querying the
    database every single time.

    On 12/7/05, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > Jürgen,
    >
    > Your broad remark has nothing to do with Joseph's question that has a
    > simple and trivial solution. From this post and some other of your
    > earlier posts, I think you misunderstood how caching works. You do
    > realize that caching is not some inevitable evil, but simply another
    > useful feature? You are free to turn it off.
    >
    > Good thing about Cayenne caching is that you can tweak what to cache
    > and what to refresh, giving you the best performance in your specific
    > situation, but you can always opt out of it all together. Here is a
    > few tips that will hopefully clear the confusion:
    >
    > (1) SelectQuery with properly configured prefetches will go a long
    > way in providing you with fresh objects on every request. This way
    > you are in control of refreshing parts of the object graph.
    >
    > (2) Combine (1) with replacing a DataContext on every request (i.e.
    > do not store DataContext in the session). Don't use DataObjectUtils
    > for PK lookup (this is just a shortcut; you can use a SelectQuery
    > that refreshes data).
    >
    > (3) If this is still not enough, you can configure Cayenne stack to
    > avoid cache between multiple DataContexts. Simply uncheck "Use Shared
    > Cache" checkbox for the DataDomain in the Modeler. See the first
    > picture on this page for explanation:
    >
    > http://objectstyle.org/cayenne/userguide/design/caching.html
    >
    > Andrus
    >
    >
    > On Dec 7, 2005, at 9:47 AM, Jürgen Saar wrote:
    > > Caching is really a problem if there are
    > > non-cayenne actions on the database.
    > >
    > > We are actually looking for alternatives to cayenne
    > > because the trouble about caching
    > > has become 'missing-critical'.
    > > For our customer there is no acceptance for
    > > seeing 'old' data in an actual requests.
    > >
    > > cayenne-use..bjectstyle.org schrieb am 06.12.05 21:50:51:
    > >>
    > >> Hi,
    > >>
    > >> I am refreshing an object I have loaded to update it if the DB has
    > >> changed it while I am looking at it. I noticed that
    > >> DataObjectUtils.objectForPK() is caching and I would like it not
    > >> to, or
    > >> find another way to get the object by id using a query. Any ideas?
    > >>
    > >> Thanks,
    > >> Joseph
    > >
    >



    This archive was generated by hypermail 2.0.0 : Wed Dec 07 2005 - 08:57:43 EST