Re: 3t and performance

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Feb 06 2006 - 13:39:57 EST

  • Next message: jira-norepl..bjectstyle.org: "[OS-JIRA] Created: (CAY-440) Partial support for one-to-many relationship with a source column that is not a PK."

    Hi Marcin,

    I got a bit stuck with some of my current work, namely a generic
    algorithm for transferring objects between contexts. This sounds
    simple, but considering that I wanted to reuse the same algorithm in
    many different places (server->server context;server-client
    "detached" objects;detached objects -> client context;traversal
    according to prefetch spec; traversal of all resolved objects), it
    becomes very non-trivial.

    But while I am banging my head against the wall with that, I think
    you can go ahead with adding extra cache levels to CayenneContext. My
    current work hopefully won't interfere with it. Look at
    org.objectstyle.cayenne.util.ObjectContextQueryAction and its
    DataContext-specific subclass - DataContextQueryAction. DataContext
    variety has methods 'interceptLocalCache' and
    'interceptPaginatedQuery'. This is what we need to develop for
    CayenneContext.

    You may start by ridding IncrementalFaultList from DataContext
    dependency, replacing it with ObjectContext interface. As for
    'interceptLocalCache', I think we need two new methods in
    GraphManager interface: 'List getNodes(String cacheKey)' and 'void
    setNodes(String cacheKey, List nodes)' to allow storing cached lists,
    and a corresponding backend implementation.

    Keep the list posted on how it goes, and if you have any questions,
    please ask.

    Andrus

    On Jan 29, 2006, at 9:52 PM, Marcin Skladaniec wrote:
    > Allright then, I'm waiting for the note, and I will try to work on
    > those features.
    > Cheers
    > Marcin
    >
    > On 30/01/2006, at 11:11 AM, Andrus Adamchik wrote:
    >
    >> [forwarding to devel]
    >>
    >> Appreciate that! Let's hold it off for another week or so, as I am
    >> refactoring the whole stack right now to accommodate nested
    >> contexts. Once the code stabilizes (I'll send a note to DEVEL or
    >> maybe even post an M11 milestone), it would be cool if you could
    >> work on that.
    >>
    >> This is the environment setup instructions (you may have been
    >> through this already):
    >>
    >> http://objectstyle.org/confluence/display/CAY/Developer+Guide
    >>
    >> Now the code... Based on the way things look now, we would need an
    >> analog of DataContextSelectAction for CayenneContext. Current CVS
    >> version of it (that I am actively refactoring) works sort of like
    >> a chain of filters handling different query flags in turn, and
    >> fetching only if results can't be obtained from cache:
    >>
    >> if (metadata.getPageSize() > 0) {
    >> return new IncrementalFaultList(context, query);
    >> }
    >>
    >> if (interceptOIDQuery() == DONE) {
    >> return this.result;
    >> }
    >>
    >> if (interceptRelationshipQuery() == DONE) {
    >> return this.result;
    >> }
    >>
    >> // intercept explicitly cached queries
    >> if (QueryMetadata.LOCAL_CACHE.equals
    >> (metadata.getCachePolicy())) {
    >> return getListViaCache();
    >> }
    >>
    >> return getList();
    >>
    >>
    >> 'interceptOIDQuery' and 'interceptRelationshipQuery' are only used
    >> for nested contexts, so you can ignore that at the moment.
    >>
    >> Andrus
    >>
    >>
    >> On Jan 29, 2006, at 6:55 PM, Marcin Skladaniec wrote:
    >>
    >>>
    >>> I was thinking about helping you with that feature, but I have
    >>> any clue where to start ...
    >>> Thank you,
    >>> Marcin
    >>>
    >>>
    >>> On 30/01/2006, at 10:02 AM, Andrus Adamchik wrote:
    >>>
    >>>> Marcin,
    >>>>
    >>>> Both features (result list caching and query pagination) are not
    >>>> yet supported by CayenneContext (and therefore not available on
    >>>> the client). I am working on something else right now, but I am
    >>>> planning to add this in the nearest future.
    >>>>
    >>>> Andrus
    >>>>
    >



    This archive was generated by hypermail 2.0.0 : Mon Feb 06 2006 - 13:39:59 EST