It would also show the "colocation" feature that you and Bill have built in the 
clustering of JBoss. If the bean is configured on the target Jetty node then we 
colocate and take care of state synchronization under the covers, if we are not on the 
same node, then the logic from jetty IS THE SAME, he looks up an entity loads stuff 
from it, stores stuff to it, and he never knows whether the bean is local or not.  If 
it is local then it is all optimized stack, if it is not then it is calls to another 
VM.

Even in the last case, the state IS NOT STORED TO DB, in fact the FIRST case I would 
show is a persistence engine that is just in VM, therefore IT DOES NOT DO ANYTHING 
WITH THE DB, they are sessions and they are not supposed to survive crashes.  If we 
want persistence then having the bean replicated across VMs with your excellent SFSB 
replicator slightly tuned to be a very simple CMP engine (that just supports the 
findByPrimaryKey) then we are done. 

I say we try to leverage the framework you have put in place Sacha, I think we will be 
pleasantly surprised.

So julian
1- work with the entityl, even if for now it is not optimized.
jndi.lookup("HttpSessions");
session = httpSesionHome.findByPrimaryKey("myID");
create if not present.

get/put stuff to it.

You don't know if that is colocated or not.

2- Sacha.
a- create in VM CMP that is just a hashmap of HTTPSessions. NO DATABASE CALLS JUST IN 
VM. the net result will be jetty making calls to the one node serving http sessions 
(he doesn't know which one just uses the code above).  It should be reasonably fast as 
you only need the network stack to serialize from one vm to the other and there is no 
DB work involved AT ALL.  Can you create that CMP engine? the only finder should be 
the find by primary key.

b- when that is working and he is working with it, you can get really fancy and say 
"you have a replicated EJB HTTPSESSIONS on your own node, we populate the cache as the 
loadbalancers send requests your way (they can be really dumb) and we use ejbLoad to 
bring the state here, register with JavaGroups for multicast notifications of state 
change, the colocation will be done automatically with the stuff that you and bill put 
in the proxies etc etc....

does this make sense? can you indulge me and try this?
______________________________________________________________________
View this jboss-dev thread in the online forums:
http://jboss.org/forums/thread.jsp?forum=66&thread=6221

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to