Re: DataContext problem?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Apr 18 2003 - 10:13:17 EDT

  • Next message: Andrus Adamchik: "Re: Re: DataContext problem?"

    It is a popular topic in Cayenne, so I'll add my 2 cents here as well.

    I second Holger that having a request-scoped DataContext is going to be
    very inefficient.

    A possible solution (apart from implementing real cache syncing as
    suggested by Holger), is refetching the objects that are expected to be
    frequently changed. In other words you will need to fine-tune the
    application based on your judgement of what is important to refresh and
    what can be cached safely.

    Andrus

    > Arndt Brenschede wrote:
    >>
    >> Michael Schuldt wrote:
    >> > But the problem is with other sessions. I can't read the changes or
    >> the new objects commited fromout the other session from the
    >> database. There are only the old ones. But when I'm creating a new
    >> session, I can see everything!
    >> >
    >> > Any suggestions? It's very urgent.
    >>
    >> Well, what you describe is what you should expect (?) ...
    >
    > Yes.
    >
    >> So this DataContext works like a cache, and
    >> you don't get notified if an object changes in
    >> the Database.
    >
    > This has been discussed before, see this thread & followups:
    > http://objectstyle.org/cayenne/lists/cayenne-user/2003/02/0022.html
    >
    > 'request-lifetime' DCs are not really a solution, either (although they
    > might work for simple scenarios). An application-level
    > DataContextMonitor (watching e.g. over all DCs in all 'sessions')
    > implemented as outlined in the thread would be a good first step to keep
    > at lesst several DCs in the same VM in sync.
    >
    > Holger



    This archive was generated by hypermail 2.0.0 : Fri Apr 18 2003 - 10:13:17 EDT