<div dir="ltr"><div><div><div>Thank you Mark for the useful information! I forgot to cc cdi-dev:(. Yes, I meant the session failover in a cluster containing multiple servers. <br></div>From what you described, it seems the session failover can only occur among the servers containing the same level of OWB. It is going to be very tricky to get OWB 1.0/1.1 to failover to OWB 1.2 servers. The serialization/deserialization is very different.<br><br></div>I believe in Weld, the Weld generated subclass is stored in the session. Martin K, please correct me if I am wrong.<br><br></div>To move forward, can we work out a plan to support failover among different CDI levels of the same kind in the future CDI releases as the current failover support is a real limitation?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 9:29 AM, Mark Struberg <span dir="ltr">&lt;<a href="mailto:struberg@yahoo.de" target="_blank">struberg@yahoo.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Deliberately private? Or did you simply forget to cc cdi-dev? Feel free to forward my answers to the list.<br>
<span class=""><br>
<br>
&gt; The EJB spec does not say anything about failover.<br>
<br>
</span>Yes it says nothing about session failover or session replication. It is pretty vocal about remoting however. And this is technologically very close to clustering on many servers (Server talking to another Server).<br>
We probably have to explicitly distinguish a simple Session failover to a functional clustering aka scale up (mostly @Remote).<br>
<br>
Guess you are just refering to the former, right?<br>
For EJBs you can also only have @Stateful beans affected by session replication. And only if you store them in the Session (which gets replicated) of course. Or since EE6 if they are annotated with a CDI Scope annotation which ends up in the http session along the line (@SessionScoped, @ConversationScoped, various custom scopes, e.g. DeltaSpike @WindowScoped or @ViewAccessScoped). Or an @Dependent @Stateful which gets injected in a bean which ends up in the HttpSession.<br>
Any other EJBs which might get moved to another cluster node as a whole?<br>
<br>
Re OWB 1.1 and 1.2 compat. I fear it’s not easy. The ‚Contextual Instance‘ stored in OWB-1.1 is _always_ without any interceptors or decorators. It doesn’t even contain any javassist dependencies. BUT if you inject any other NormalScoped bean into it _THEN_ you will have the ‚proxy shale‘ for those. And they of course contain javassist classes.<br>
<br>
In OWB-1.0 and 1.1 we also had a single ‚unified‘ proxy stack which contained NormalScoping, Interceptor logic and Decorator logic.<br>
In OWB-1.2 and up we did split this and now have 3 different proxies: NormalScoping proxies aka the ‚Contextual References‘. They are _not_ part of the Contextual Instance. Then we have Interceptor/Decoratpr Proxies (both in a single proxy class) and for abstract Decorators we also generate a simple proxy which just implements the missing methods. The later 2 proxies are part of the ‚Contextual Instance‘ and thus get stored in the ContextualInstanceBag/SessionContext in the HttpSession.<br>
And of course you have the same impact of injected NormalScoped beans into a e.g. @SessionScoped bean as with OWB-1.1.<br>
<br>
<br>
I guess that wou will get hit with similar constellations in Weld as well.<br>
<br>
<br>
LieGrue,<br>
strub<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
&gt; Am 11.10.2015 um 22:28 schrieb Emily Jiang &lt;<a href="mailto:emijiang6@googlemail.com">emijiang6@googlemail.com</a>&gt;:<br>
&gt;<br>
&gt; The EJB spec does not say anything about failover. Some EJB implementations can support failover between different server levels. I am talking about failover among the same kind. I don&#39;t believe OWB can support failover between cdi 1.0 and cdi 1.2, neither does Weld can do.<br>
&gt;<br>
&gt; On Fri, Oct 9, 2015 at 12:53 PM, Mark Struberg &lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt; wrote:<br>
&gt; Wonder the same. I’m 100% sure that it is NOT portable for NIV. Wheras for EJB2 style EJBs it _might_ working due to RMI/IIOP (Though don’t remember whether this was only specified for remoting or also for clustering. Nor do I remember if the spec said anything about clustering at all).<br>
&gt;<br>
&gt; I guess there often is ‚additional‘ wrapper stuff handed over in addition to the normal beans for EJB3 style EJBs. I know for sure that we do exactly that in OpenEJB. We have additional wrappers e.g. for transported Exceptions when doing remoting. We hand over the ’string representation’ and the original Exception stack data separately. In case we cannot de-serialize the Exception on the other side. Think about sending some OptimisticLockException (or even some internal Hibernate Exception) over to an EJB client which doesn’t have any Hibernate jars and not even the jaa-spec jar on it’s classpath… Similar additional information might be stored in any EJB proxy. Or think about Extended Persistence Contexts. How should that ever work to be serialized between e.g. WildFly and Glassfish? How would you replicate over some Hibernate Exception if the other node is running Glassfish with EclipseLink? :)<br>
&gt;<br>
&gt; LieGrue,<br>
&gt; strub<br>
&gt;<br>
&gt;<br>
&gt; &gt; Am 09.10.2015 um 12:54 schrieb Martin Kouba &lt;<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>&gt;:<br>
&gt; &gt;<br>
&gt; &gt; I wonder whether this behavior is defined somewhere, i.e. if all EJB<br>
&gt; &gt; implementations must support &quot;failover&quot; between minor versions (e.g. EJB<br>
&gt; &gt; 3.0 and 3.2), in other words the passivation mechanism may not change.<br>
&gt; &gt; This would mean that an EJB app might be deployed to a &quot;cluster&quot; of<br>
&gt; &gt; mixed Java EE 6 and Java EE 7 app servers - seems to me like an<br>
&gt; &gt; extremely risky experiment.<br>
&gt; &gt;<br>
&gt; &gt; Martin<br>
&gt; &gt;<br>
&gt; &gt; Dne 9.10.2015 v 11:42 Emily Jiang napsal(a):<br>
&gt; &gt;&gt; I am investigating the HttpSession failover for SessionScoped or<br>
&gt; &gt;&gt; ConversationScoped beans. I think it is not easy to failover from the<br>
&gt; &gt;&gt; CDI 1.0 impl to CDI1.2 impl, as the bean proxies instead of the raw bean<br>
&gt; &gt;&gt; was serialised and the proxies are different between cdi 1.0 and cdi<br>
&gt; &gt;&gt; 1.2. Has anyone have any thoughts on this? If not possible, this is a<br>
&gt; &gt;&gt; big limitation for CDI as EJB container has no such limitation.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; --<br>
&gt; &gt;&gt; Thanks<br>
&gt; &gt;&gt; Emily<br>
&gt; &gt;&gt; =================<br>
&gt; &gt;&gt; Emily Jiang<br>
&gt; &gt;&gt; <a href="mailto:ejiang@apache.org">ejiang@apache.org</a> &lt;mailto:<a href="mailto:ejiang@apache.org">ejiang@apache.org</a>&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; cdi-dev mailing list<br>
&gt; &gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Martin Kouba<br>
&gt; &gt; Software Engineer<br>
&gt; &gt; Red Hat, Czech Republic<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; cdi-dev mailing list<br>
&gt; &gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt; &gt;<br>
&gt; &gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; cdi-dev mailing list<br>
&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;<br>
&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Thanks<br>
&gt; Emily<br>
&gt; =================<br>
&gt; Emily Jiang<br>
&gt; <a href="mailto:ejiang@apache.org">ejiang@apache.org</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Thanks<br>Emily<br>=================<br>Emily Jiang<br><a href="mailto:ejiang@apache.org" target="_blank">ejiang@apache.org</a><br></div>
</div>