The electedTarget field in FirstAvailable is transient. So, if the policy is serialized the target will be lost and the next request will choose a different target.
I'm wondering what the reason for making this transient was.
Having it transient leads to problems if the bean proxy is serialized, since following deserialization another target will be chosen. For example, when a clustered EJB3 SFSB has another bean injected, when the parent context is replicated, the child bean proxy is replicated as well. If there is a failover on a call to the parent, the child proxy is no longer sticky, which can lead to odd behavior (see http://www.jboss.com/index.html?module=bb&op=viewtopic&t=101220).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027619#4027619
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027619
Brian,
Just went through your proposed solution - the problem with the solution is that if there are 2 clusters, each with @Clustered SFSBs with identical ejbNames, when a bean in cluster A looks up a proxy in cluster B and then invokes on that proxy, we will get a local invocation instead of the remote invocation. Seems like we need a way, other than ejbName, to identify if the container is local.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027614#4027614
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027614
So the EJBTHREE-873 issue is that people didn't want the EJB2 behavior of forcing the call locally? The EJB2 InvokerInterceptor will do that, but only if the bean is clustered.
| public boolean isLocal(Invocation invocation)
| {
| // No local invoker, it must be remote
| if (localInvoker == null)
| return false;
|
| // The proxy was downloaded from a remote location
| if (isLocal() == false)
| {
| // It is not clustered so we go remote
| if (isClustered(invocation) == false)
| return false;
| }
|
| // See whether we have a local target
| return hasLocalTarget(invocation);
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027606#4027606
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027606