<p dir="ltr">Hi</p>
<p dir="ltr">+1 to clarify it. All normal scope dont need Serializable constraint - even session scope - and it makes sense to not respect it in a lot of apps without preventing these beans to be serializable thans their proxies.</p>
<p dir="ltr">Best IMO is to either remove it or to allow a scope serializer service to be specified to keep it portable.</p>
<p dir="ltr">Wdyt?</p>
<div class="gmail_quote">Le 1 févr. 2015 13:36, &quot;Antonio Goncalves&quot; &lt;<a href="mailto:antonio.goncalves@gmail.com">antonio.goncalves@gmail.com</a>&gt; a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I was reading the CDI 1.2 spec and couldn&#39;t clearly find the way serialization and scopes work. The only explicit sentence I found was : </div><div><br></div><div><br></div><div><div><i>1.3.1. JSF example</i></div><div><i>The @SessionScoped annotation defined in Section 2.4.1, “Built-in scope types” is a scope<br></i></div><div><i>type that specifies the lifecycle of instances of Login. <b>Managed beans with this scope must be</b></i></div><div><i><b>serializable.</b></i></div><div><br></div><div><br></div><div>The Weld documentation is a bit more explicit : </div><div><br></div><div><div><i>5.2. Built-in scopes</i></div><div><i><b>Managed beans with scope @SessionScoped or @ConversationScoped must be serializable</b>, since the container passivates the HTTP session from time to time.</i></div></div><div><br></div><div><br></div><div>And in the Java EE Tutorial we find (<a href="http://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html" target="_blank">http://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html</a>) : </div><div><br></div><div><span style="font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><b><font color="#000000">Beans that use session, </font><font color="#ff0000">application</font><font color="#000000">, or conversation scope must be serializable</font></b><font color="#000000">, but beans that use request scope do not have to be serializable.</font></span><br></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px">This even made be doubt about the application scope ?!?</span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px">Any way, could we clarify this in the CDI spec ?</span></div><div><span style="color:rgb(0,0,0);font-family:Arial,Helvetica,FreeSans,Luxi-sans,&#39;Nimbus Sans L&#39;,sans-serif;font-size:12px"><br></span></div><div><br></div>-- <br><div><div dir="ltr">Antonio Goncalves <br>Software architect, Java Champion and Pluralsight author<br><br><a href="http://www.antoniogoncalves.org" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://pluralsight.com/training/Authors/Details/antonio-goncalves" target="_blank">Pluralsight</a> | <a href="http://www.parisjug.org" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr" target="_blank">Devoxx France</a></div></div>
</div></div>
<br>_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
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" 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></blockquote></div>