[jboss-user] [Clustering/JBoss] - Re: How do servlets communicate with session beans across cl

bstansberry@jboss.com do-not-reply at jboss.com
Mon Apr 7 23:00:23 EDT 2008


What's I believe is happening here is as follows:

When you look up your SLSB in JNDI, the servlet actually downloads a cluster-aware proxy to the EJB.  The proxy includes information about the topology for that EJB, i.e. that it is deployed on {Y, Z}.

That topology gets updated 1) whenever you make a request that fails (node that failed is remove from list on client side) 2) if you make a request that succeeds and the server detects that your client side proxy is out of sync with what the server knows 3) if you download a new proxy by doing a new JNDI lookup.

So, let's go through your scenario, showing what the client sees as the cluster topology, and what the server side situation actually is.

Legend for the following:

Action : { client-side view of topology } : {actual server-side topology}

So:

1) download proxy via JNDI lookup : { Y, Z } : { Y, Z}
2) make request: { Y, Z } : { Y, Z}
3) kill Y, request fails over to Z: { Z } : { Z}
4) start Y, request to Z ongoing: { Z} : { Y, Z }
5) kill Z, ongoing request to Z aborted: {} : { Y, Z }

In step 4/5, your client never made a new request to the cluster so it was never informed that Y was available.  When Z fails, the client sees no available servers and fails.

If you had made a new request to Z after step 4 but before 5, you would have gotten a new topology { Y, Z }, and then failover would have worked in step 5. If you did a new JNDI lookup you'd also get an updated topology.

Our EJB2 clustering code has a feature called the RetryInterceptor that can deal with this situation. See http://wiki.jboss.org/wiki/RetryInterceptor .  

There is no analogue yet for EJB3, as the way the proxies work is different.  JIRA for adding one is http://jira.jboss.com/jira/browse/EJBTHREE-1002 .

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

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



More information about the jboss-user mailing list