FAQ
Hi List

I'm using cayenne 3M4.

I'm a but confused with how to handle the cache.

I have two objects A related to B in a one to many relationship.
when I add objects B objects related to A, and immediately in a
subsequent call ask for those B objects related to A, the new B objects
are not present, though they are after trying the call again after a few
seconds.

To fix it, once I added a B object to A's B objects, I set object A as
hollow, so
that the next time A is used, it reloads...

Is this the right way to make objects refresh their cache ?
Its a web application, and the same dataContext is used in the different
calls that
use object A.

Ian

Search Discussions

  • Andrus Adamchik at Aug 26, 2008 at 12:22 pm
    This should work within the sane DataContext - you should see the
    object on the opposite end of relationship immediately. Can you post
    the relevant code that you are using to set and check the
    relationship? Also what happens in these few seconds (i.e. if this is
    a web application, does it happen in the same request)?

    Andrus

    On Aug 26, 2008, at 8:10 AM, Ian Jamieson wrote:

    Hi List

    I'm using cayenne 3M4.

    I'm a but confused with how to handle the cache.

    I have two objects A related to B in a one to many relationship.
    when I add objects B objects related to A, and immediately in a
    subsequent call ask for those B objects related to A, the new B
    objects
    are not present, though they are after trying the call again after a
    few
    seconds.

    To fix it, once I added a B object to A's B objects, I set object A as
    hollow, so
    that the next time A is used, it reloads...

    Is this the right way to make objects refresh their cache ?
    Its a web application, and the same dataContext is used in the
    different
    calls that
    use object A.

    Ian
  • Ian Jamieson at Aug 27, 2008 at 1:32 am
    I first need to make sure it's not a stupid being done by me.
    I'll see if I can put an easily repeatable small example together on the
    weekend, and post the
    code from that rather.

    On Tue, Aug 26, 2008 at 8:22 PM, Andrus Adamchik wrote:

    This should work within the sane DataContext - you should see the object on
    the opposite end of relationship immediately. Can you post the relevant code
    that you are using to set and check the relationship? Also what happens in
    these few seconds (i.e. if this is a web application, does it happen in the
    same request)?

    Andrus



    On Aug 26, 2008, at 8:10 AM, Ian Jamieson wrote:

    Hi List
    I'm using cayenne 3M4.

    I'm a but confused with how to handle the cache.

    I have two objects A related to B in a one to many relationship.
    when I add objects B objects related to A, and immediately in a
    subsequent call ask for those B objects related to A, the new B objects
    are not present, though they are after trying the call again after a few
    seconds.

    To fix it, once I added a B object to A's B objects, I set object A as
    hollow, so
    that the next time A is used, it reloads...

    Is this the right way to make objects refresh their cache ?
    Its a web application, and the same dataContext is used in the different
    calls that
    use object A.

    Ian

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedAug 26, '08 at 5:11a
activeAug 27, '08 at 1:32a
posts3
users2
websitecayenne.apache.org

2 users in discussion

Ian Jamieson: 2 posts Andrus Adamchik: 1 post

People

Translate

site design / logo © 2021 Grokbase