Hi<br><br>On Thursday, March 19, 2015, Mark Struberg &lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt;&gt; but opposed to ee concurrency utilities<br>
&gt;<br>
&gt; I thought this was by mistake rather than design?<br>
<br>
<br>
<br>
As far as I remember there was a long discussion on the EJB EG and it was intentionally that @Asynchronous does NOT propagate any information about the session, security, and don’t even share the same pool instance from @Stateless (pool ~what we have as @RequestScoped).</blockquote><div><br></div>Slightly off topic perhaps, but @Stateless is difficult to map to a (CDI) scope. Everytime a method is called on a proxy, a different actual bean instance can be used (but it can also be the same bean instance as used for the previous call from the same thread)<div><br></div><div>The concept is actually not that far removed from a message passing paradigm, but using synchronous communication and a typed target.</div><div><br></div><div>Kind regards,</div><div>Arjan Tijms<br><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The reason is that EJB is all about removing concurrency complexity from the user as good as possible. The other problem is that you don’t have it under control how long the new thread will run. And the Session might be looong time dead already. Another issue is with TX handling. The JPA spec and also JTA spec (TransactionSynchronizationRegistry) defines that a transaction must not be used ‚concurrently‘. Means they only must be assigned to a very single Thread.<br>
<br>
Even with servlet 3.0 async requests you have a ServletRequest only attached to a very single thread AT EACH TIME (means the thread might switch, but it’s max 1 at a time).<br>
<br>
<br>
<br>
LieGrue,<br>
strub<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;cdi-dev@lists.jboss.org&#39;)">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.</blockquote></div>