FAQ
Hello

I have two contexts containing the same entity.
- one contains the list of all entities of this type - ListContext
- second contains only one entity for editing - EditContext

I would like to notify the relevant context(s) when the object
changes, so it needs to be refreshed. How can I do it ? I thought
there was a notification mechanism in 3t-cayenne, but I cant find a
word about it anymore.

What is the best way to force object to be re-faulted from database ?
I tried to set persistence state to hollow but it does not work.

Regards
Marcin


-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001 fax +61 2 9550 4001

Search Discussions

  • Andrus Adamchik at Apr 28, 2006 at 12:38 pm

    On Apr 28, 2006, at 3:55 AM, Marcin Skladaniec wrote:

    Hello

    I have two contexts containing the same entity.
    - one contains the list of all entities of this type - ListContext
    - second contains only one entity for editing - EditContext

    I would like to notify the relevant context(s) when the object
    changes, so it needs to be refreshed.
    Hmm... If those two contexts use the same ClientChannel,
    synchronization should be automatic. Of course it only happens on
    commit.
    How can I do it ? I thought there was a notification mechanism in
    3t-cayenne, but I cant find a word about it anymore.
    The even mechanism was simplified (you may say downgraded) compared
    to the earlier version. I need to updated the docs. You can listen to
    the ClientChannel events. To register a listener implement
    DataChannelListener and use EventUtil class to register it.

    If you need to receive ongoing object events (i.e. property changes
    that by themselves do not result in commit), you can subclass
    CayenneContext and override 'propertyChanged'

    What is the best way to force object to be re-faulted from
    database ? I tried to set persistence state to hollow but it does
    not work.
    Yeah, unfortunately client invalidate functionality didn't make it to
    1.2. One way to work around this is an explicit refresh query:

    Query q = new ObjectIdQuery(oid, false, ObjectIdQuery.CACHE_REFRESH)

    Andrus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedApr 28, '06 at 7:55a
activeApr 28, '06 at 12:38p
posts2
users2
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase