Unfortunately, the activate/inactivateRegion API is designed with the intention
that the inactive region is not being used locally either, prior to activation.
When you activate a region, its going to request the state for that region
from the other node, throw away anything it already has (the design intent is
it shouldn't have anything), and put the state received from the other node in
the local tree.
I just wrote the docs for this a couple days ago, and your idea makes me
realize I wasn't specific about that point (no help to you, but thanks!).
I'm wondering if it might be possible for you to subclass TreeCacheAop to get
what you want. You would add this method
| public void activateRegion(String subtreeFqn, boolean fetchState)
| throws RegionNotEmptyException, RegionNameConflictException,
CacheException
| {
| if (fetchState) {
| super.activateRegion(subtreeFqn);
| }
| else if (useMarshalling_) {
| marshaller_.activate(subtreeFqn);
| }
| else {
| throw new IllegalStateException("TreeCache.activateRegion().
| useMarshalling flag is not set!");
| }
| }
|
This bypasses the state fetch and thus the discard of the existing state.
Please consider the above another wild suggestion, not something I've thought
through carefully enough to call a recommendation :)
A couple problems:
1) With the above code, once you activate you may get a commit message from the
other server for a tx for which you didn't receive a prepare message. This
will throw an exception. The exception won't cause the tx to fail on the other
end, but you'll get errors in your logs on the end that threw the exception.
2) How are you going to keep these caches properly in sync? If they're both
loading state from some initial shared source, but then one node goes live and
begins changing the state, while the other is still loading, how will they ever
synchronize? This is a general problem that exists no matter how you solve the
problem of not replicating doing initial load.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3901011#3901011
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3901011
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user