Re: read-only entities

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed May 26 2004 - 10:16:02 EDT

  • Next message: Mike Kienenberger: "Re: read-only entities"

    On May 26, 2004, at 9:55 AM, Bryan Lewis wrote:
    > On Apr 7, 2004, Andrus Adamchik wrote:
    >> The main inefficiency to be solved with "enumerated" or "lookup"
    >> tables is ... the fact that these read-only objects that are almost
    >> never modified in the DB have to be fetched over and over again. The
    >> way I usually handle this is by implementing a class-level cache.
    >> ...
    >> In 1.1 we may make this more transparent. Stay tuned.
    >
    > I'm about to implement this kind of cache for my lookup tables, but
    > thought I might be doing needless work when I saw the "Stay tuned".
    > Is something coming in 1.1 to facilitate this?

    Yes, in fact I was going to implement this in the next milestone
    (http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-36). Though
    this work hasn't started yet...

    > Another related question... If I declare an entity to be read-only in
    > the
    > modeler, I see that it does make the object read-only since the class
    > generator doesn't emit any setter methods. I thought the objects
    > might also
    > get cached automatically and would be fetched only once (after seeing
    > the above
    > comments). That doesn't seem to be the case, and I need to implement
    > my own
    > cache even for R/O objects. True?

     From technical standpoint this is the same issue as above, and will
    likely be handled similarly in Cayenne. However I would think that
    read-only entities should not always be cached. They may be read-only
    from your app perspective, while your DBA may load them manually via a
    scheduled job. So you may still want to refresh them, even though the
    app never modifies these objects.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed May 26 2004 - 10:16:07 EDT