Thanks for the reply Ben.  Probably you didn't understand my question because I 
was a little long-winded and not altogether to-the-point.  I'll try to state 
what I want to do more succinctly.


* I want to maintain a unique (global) collection of objects (user activity 
records) for a clustered application.

* I only want to have one and only one such collection of objects, no matter 
how many nodes I have in my cluster.

* The collection of objects should be available to the application components 
(Servlets and EJBs) across all nodes of the cluster.

* I will update an object in this collection whenever there is a user activity.

* A crash of one or more nodes of the cluster should not hose the collection, 
i.e. it should still be intact and available to all other surviving nodes of 
the cluster.


What I'm asking is whether or not I can cook up an MBean (or any other 
component) which uses JBossCache to store a collection of objects and which can 
be available to all nodes of a cluster and survive a failure of the node it was 
started on.  If so then how would I deploy the MBean so that it behaves 
essentially as a Singleton, with both replication and failover, without 
resorting to an HASingleton approach (since that doesn't appear to provide 
replication or failover) ?

I have tried this already using an MBean (I'm calling it UserActivityManager) 
which stores the objects in a HashMap, and which is deployed as an HASingleton. 
 It is working well but still it's only a partial solution since HASingletons 
don't appear to support true failover, in that when the master node which 
provides the HASingleton goes down the HASingleton MBean is lost for good (no 
real replication or failover).  With this approach I need to access the object 
collection via the MBean by way of an RMIAdaptor.  You can see details of this 
in a posting I added a few months back: 
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=55794.  My feeling is 
that this is really a hack and that there must be a more elegant solution.  I 
have been instructed by my manager to investigate using JBossCache instead, and 
from my preliminary efforts at getting it to work it looks as if this is not 
the right thing to be using for the job.  The idea is that I can use JBossCache 
as sort of an in-memory cache where I can store my objects, and since 
JBossCache looks to have some replication abilities I assumed that it could be 
used to replicate and share a cache of objects across nodes of a cluster.  It's 
not clear to me that this is true, and that maybe my idea of replication is not 
the same thing as the replication provided by JBossCache.  As far as failover 
goes it doesn't appear to be provided by JBossCache either, and if not then it 
is definitely not the right service to be using for the solution I need.

My impression is that instead of using JBossCache this would be a better solved 
by using Hibernate objects, since the objects I want to store could be kept in 
a central persistent database and accessible to all components of my 
application regardless of which node of a cluster they happen to be running on 
at the time of access.  In this approach I wouldn't need to maintain the object 
collection in an MBean itself but instead the MBean would access the objects as 
Hibernate objects, as would the other components of the application.  There 
would be no need to roll my own replication and failover capabilities (as I'm 
currently doing by using an HASingleton MBean) since this is provided by virtue 
of keeping the objects in a central database which is not going to lose the 
data if any one node of my clustered application fails.

What I'm hoping for is some guidance from those of you reading this forum who 
are more experienced and knowledgeable on these topics, as I'm not enough of an 
expert to be able to say one way or another which approach is best.  I don't 
want to waste my time again by using the wrong tool for the job.

I've again been long-winded, but hopefully I've explained the problem more 
clearly.  Thanks in advance for any suggestions or insight.


--James

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3868523#3868523

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3868523


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to