cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Question about events in a clustered environment
Date Thu, 26 May 2011 18:26:05 GMT
Good question... There are 2 things that are easily clustered out of the box:

1. Snapshot events (events used internally by Cayenne to synchronize object state). Those
are triggered by ObjectContext commit operations. 

2. Cache group events used to invalidate query cache groups across the cluster. Those are
triggered manually by the application code by calling QueryCache.removeGroup(..) if the underlying
QueryCache supports clustering. In 3.1 we provided some utilities on automating of these events:
http://svn.apache.org/repos/asf/cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/cache/CacheInvalidationFilter.java

Lifecycle events are not clustered. Object callbacks are local to ObjectContext (so peer objects
in other contexts in the same app do not receive them), so clustering them makes no sense.
Lifecycle *listeners* (that are not persistent objects) are only notified of events on local
VM objects. But the listeners can generate their own clustered events of course (CacheInvalidationFilter
mentioned above is one example of this).

Andrus


On May 17, 2011, at 4:15 PM, Dave Lamy wrote:
> Hey guys--
> 
> In a clustered cayenne environment (I'm using the JMS event bridge), do all
> nodes receive all cayenne events (talking preInsert, postUpdate, etc etc).
> Only some of them?  None of them?  I just realized I may be making some
> massive assumptions here.
> 
> Thanks,
> Dave


Mime
View raw message