Re: Caching problem

From: Mike Kienenberger (mkienen..laska.net)
Date: Fri Apr 22 2005 - 10:50:02 EDT

  • Next message: Mike Kienenberger: "Re: Track changes of a dataobjects property"

    Fredrik Liden <flide..ranslate.com> wrote:
    > That seems to be what's happening, changes not propagating back to the
    > shared one (even though the changes are made to the database).
    > I don't know that I'm using some shared DataContext though.
    > It's a webapp and I'm using the listener to get the Context and then
    > getting the context from the session for each request.
    >
    > Is is possible that a call to
    > BasicServletConfiguration.getDefaultContext(request.getSession()); where
    > the session is not valid would create a new temporary DataContext?

    Not only is it possible, it's the only way it can work. If there's no
    session in which to store or retrieve the DataContext, then it must create a
    new context each time.

    An easy way to debug this problem would be to output the DataContext each
    time you grab it. Then you can see if the expected DataContext is being
    used in each request.

    > Using BasicServletConfiguration.getDefaultContext(request.getSession());
    > is the same as getting it for the first request and then specifically
    > store it in the session with a setAttribute right?

    Yes, if "getting it" means creating it.

    > Also I'm doing a lot of in-memory queries on the object in question.
    > Could is posssible that this could affect the propagation somehow?

    I doubt it.

    -Mike



    This archive was generated by hypermail 2.0.0 : Fri Apr 22 2005 - 10:48:25 EDT