Hi,<div><br></div><div>I agree that there should be two instances of the stateful bean, so GF3/EAP6 is correct.</div><div><br></div><div>It&#39;s remarkable then that seemingly GF4 and WF8 have the exact same integration regression.</div><div><br></div><div>At any length this would be a good case for adding an extra test to the TCK ;)</div><div><br></div><div>Kind regards,</div><div>Arjan<br><br>On Monday, December 8, 2014, Jozef Hartinger &lt;<a href="mailto:jharting@redhat.com">jharting@redhat.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Steve,<br>
    <br>
    this is not caused by a change in the specification nor in Weld. It
    is probably a regression in GlassFish integration. The correct
    behavior is the former (2 instances) as that is aligned with how
    @Dependent instances work in general. If you need the bean instance
    to be shared across injection points, you can give it a scope other
    than @Dependent.<br>
    <br>
    HTH,<br>
    <br>
    Jozef<br>
    <br>
    <div>On 12/08/2014 06:08 PM, Steve Millidge
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      
      
      
      <div>
        <p class="MsoNormal">Hi <u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal">We are investigating a change in behaviour
          between Java EE 6 and Java EE 7 and were wondering if this is
          a bug or a specification change;<u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal">If there is a RequestScoped bean and SFSB
          like below, and I call invokeStatefulService() on the Request
          Scoped Bean the behaviour changes depending on Java EE
          version;<u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal">On GFv3 and JBoss EAP 6 the method returns
          &quot;init&quot; implying we have 2 separate SFSB instances.<u></u><u></u></p>
        <p class="MsoNormal">and on GFv4 and WildFly the method returns
          &quot;stateFromFirst&quot; implying there is 1 SFSB instance.
          <u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal">I would’ve imagined that the second result
          i.e. 1 SFSB as there is 1 client bean which exists for the
          duration of the call is the correct behaviour. However I am
          not sure.<u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal">As both appservers above use JBoss Weld for
          CDI is this a Weld bug or did the behaviour change between
          Java EE 6 and Java EE 7?<u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">@RequestScoped<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">public class
            Injection {<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">   
            <u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    @Inject<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">   
            StatefulService first;<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    @Inject<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">   
            StatefulService second;<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">   
            <u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    public
            String invokeStatefulService(){<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">       
            first.setState(&quot;stateFromFirst&quot;);<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">        return
            second.getState();<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    }<u></u><u></u></span></p>
        <p class="MsoNormal"><span>}<u></u><u></u></span></p>
        <p class="MsoNormal"><span><u></u> <u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">@Stateful<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">public class
            StatefulService {<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">   
            <u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    private
            String state;<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">   
            <u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    @PostConstruct<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    public void
            init(){<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">       
            this.state = &quot;init&quot;;<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    }<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    public void
            setState(String state) {<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">       
            this.state = state;<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    }<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    public
            String getState() {<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">        return
            state;<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">    }<u></u><u></u></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span style="font-family:&quot;Courier New&quot;">}<u></u><u></u></span></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">Steve Millidge</span><span><br>
          </span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">Director<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">C2B2</span><span><br>
          </span><b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">The Leading Independent Middleware Experts.</span></b><span> </span><span><br>
          </span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">T: 08450 539457</span><span lang="CY">
          </span><b><span style="color:#1f497d">|</span></b><span>
          </span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">M: 07920 100626</span><span lang="CY">
          </span><b><span style="color:#1f497d">|</span></b><span>
          </span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">W:
          </span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#1f497d" lang="CY"><a href="http://www.c2b2.co.uk/" target="_blank"><span style="font-family:&quot;Verdana&quot;,sans-serif;color:blue">www.c2b2.co.uk</span></a></span><span lang="CY">
          </span><b><span style="color:#1f497d">|</span></b><span>
          </span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY">E:
            <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;smillidge@c2b2.co.uk&#39;);" target="_blank"><span style="color:blue">smillidge@c2b2.co.uk</span></a></span><span><u></u><u></u></span></p>
        <p class="MsoNormal"><span><img src="cid:part3.00040500.09070205@redhat.com" alt="Main
              SIgnature May 14" width="896" height="136" border="0"></span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY"><br>
          </span><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:#548dd4">---------------------------------------------------------------------------------------------------------------</span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY"><br>
          </span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif" lang="CY">C2B2 Consulting Limited</span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif">,
          </span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif" lang="CY">Malvern Hills Science Park</span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif">,
          </span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif" lang="CY">Geraldine Road</span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif">,
          </span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif" lang="CY">Malvern</span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif">,
          </span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif" lang="CY">Worcestershire</span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif">,
          </span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif" lang="CY">WR14 3SZ</span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY"><br>
          </span><span style="font-size:7.0pt;font-family:&quot;Verdana&quot;,sans-serif" lang="CY">Registered in England and Wales: 4563419,
            Registered Office: Ardendale, Old Hollow, Malvern,
            Worcestershire</span><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1f497d" lang="CY"><u></u><u></u></span></p>
        <p class="MsoNormal"><u></u> <u></u></p>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
cdi-dev mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;cdi-dev@lists.jboss.org&#39;);" target="_blank">cdi-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a>

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.</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div>