Re: Reconciling DataContexts

From: Kevin Menard (kmenar..ervprise.com)
Date: Thu Oct 18 2007 - 17:53:18 EDT

  • Next message: Ahmed Mohombe (JIRA): "[JIRA] Created: (CAY-884) Add support for H2 Database"

    On 10/16/07 8:12 AM, "Andrus Adamchik" <andru..bjectstyle.org> wrote:

    >
    > On Oct 16, 2007, at 2:57 PM, Kevin Menard wrote:
    >> The problem with localObject is that it does not traverse the whole
    >> graph,
    >> making it practically useless in all but the most trivial situations.
    >
    > That fact is *almost* transparent as relationships of the local
    > object are expanded as needed. What it doesn't cover is modified
    > objects in the graph. This is where we could use a method like JPA
    > 'merge' that would traverse already inflated graph and clone all
    > local changes for objects attached to a given object into the target
    > context.

    I'll have to double check this. I recall that not being the case, but it
    has been some time since I last tried.

    >> What we've resorted to doing is committing the customer data, then
    >> doing a
    >> requery based on the ObjectID using the order context. This allows
    >> us to
    >> get a fully populated object. Of course, this means more trips to
    >> the DB ...
    >
    > Not at all. All contexts work off of the same DataDomain cache, so
    > lookup by ObjectId is fairly efficient. But it is not transparent, I
    > agree.

    This is probably on me then. I had to disable the cache because I was
    experiencing corruption at one point. I also had another app that modified
    the DB behind the scenes that was causing problems for the cache. With the
    new cache implementations, I could probably deal with that better. I've
    also begun moving that other app over to using ROP, which should improve the
    shared cache situation.

    So, in the case of not caching, it is a problem. But, you do have to
    question why cache isn't being used in the first place.

    >
    >
    >> I suppose the problem is exacerbated by the null context problem.
    >> If we fix that, we'd likely be in much better shape.
    >
    > So it seems to me it comes down to implementing JPA-compatible
    > "persist" and "merge" concepts on top of what we already have.

    Could be. I think I only got through the first couple chapters of the JPA
    spec. I'll have to print it out and give it a read.

    -- 
    Kevin
    



    This archive was generated by hypermail 2.0.0 : Thu Oct 18 2007 - 17:54:15 EDT