Re: Loading small tables into memory for the application lifetime

From: Michael Gentry (
Date: Mon Jun 30 2008 - 10:45:35 EDT

  • Next message: Andrus Adamchik: "Re: Loading small tables into memory for the application lifetime"

    Actually, I think in Cayenne 3 that it'll automatically pull an object
    into the DataContext if it exists in another DataContext. My memory
    is a bit rusty, though, but I'm sure someone will correct me if I am
    wrong. But in a nutshell, make a separate/global DataContext for your
    small tables and cache the data in it.

    On Mon, Jun 30, 2008 at 10:28 AM, Michael Gentry <> wrote:
    > On Mon, Jun 30, 2008 at 9:06 AM, Řyvind Harboe <> wrote:
    >> In the apps I'm working on I can generally sort tables into two
    >> categories:
    >> 1. tables that change as part of normal operation of the database
    >> and/or where the number of records is too large to fit into memory
    >> 2. various and sundry small tables. These have a small number
    >> of records, change infrequently and can easily fit into memory. Loading
    >> these tables take an instant(lest I'd categorize them as #1 tables).
    >> #1 has relationships to #2 entries. These are constantly resolved via
    >> sql queries.
    >> At a guess I'd say that 95% of all queries are to resolve relationships from
    >> #1 to #2. Ideally I should be able to mark a table as #2 via a configuration
    >> option in my application as part of hardcoded tweaking of the app.
    >> Is there a way to load #2 permanently into memory so as to avoid
    >> SQL statements to resolve relationships from #1 to #2?
    >> Since loading all #2 tables take an instant, they could be dumped if
    >> more than N seconds has passed since they were last used.
    >> --
    >> Řyvind Harboe
    >> ARM7 ARM9 XScale Cortex
    >> JTAG debugger and flash programmer

    This archive was generated by hypermail 2.0.0 : Mon Jun 30 2008 - 10:46:13 EDT