-
1. Re: How to get failover with HASingletons ?
viswaprasad Mar 23, 2005 7:58 PM (in response to monocongo)Did you try putting the state of your HASingleton in a distributed cache (like JBossCache ) instead of having it locally on your Master Singleton alone? So when the master dies and one of the slaves is promoted to Master, the state should be still accessible to it via the distributed cache. No?
-
2. Re: How to get failover with HASingletons ?
monocongo Mar 23, 2005 10:16 PM (in response to monocongo)Thanks for your response.
Yes this is exactly what I am doing now, I only wish I had known of this possibility before wasting so much time trying to use a Singleton. I now have MBeans which use the TreeCacheAop service with synchronous replication, and except for a few minor problems it is working flawlessly.
--James -
3. Re: How to get failover with HASingletons ?
ben.wang Mar 27, 2005 8:42 PM (in response to monocongo)James,
I am interested to see your use case on TreeCacheAop for this one. Would mind to share more details? :-)
You can email me (ben.wang@jboss.com) if you prefer.
Thanks,
-Ben -
4. Re: How to get failover with HASingletons ?
anuprk Mar 28, 2005 4:12 AM (in response to monocongo)Try using DistributedState of HAPartition. I have similar application where I need to share information in two nodes. All my caches are stored in DistributedState. Whenever this state is changes, jboss frameworks informs all the nodes about change in state.
Thanks,
Anup -
5. Re: How to get failover with HASingletons ?
ben.wang Mar 28, 2005 10:14 AM (in response to monocongo)DistributedState is ok but JBossCache is now recommended for the state replication since future DistributedState will be refactored using cache underneath as well.
-Ben -
6. Re: How to get failover with HASingletons ?
jcasp May 10, 2005 11:11 AM (in response to monocongo)Ben,
Does the use-case above appear in any of the cache docs? If you have any more info on this, I would very much like to read it. I want to do something similar to the above, i.e., access a distributed cache from EJBs in order to implement an in-memory, cluster-aware singleton.
I was reading through this doc:
http://docs.jboss.org/jbcache/current/TreeCacheAop/html/
I'm not sure what is necessary to integrate those examples into an EJB. Can I get a reference to a cache instance similar to the way I get, for example, a Hibernate SessionFactory via JNDI?
Thanks in advance for your help.
Justin -
7. Re: How to get failover with HASingletons ?
ben.wang May 11, 2005 12:07 AM (in response to monocongo)If you deploy your TreeCacheAop as a mbean service, you can then access from ejb (directly or through a wrapper). As a result, all memebers in the group will have the replicated state.
-Ben