Issue Type: Bug Bug
Affects Versions: 1.1.8.Final, 2.0.0.Alpha2
Assignee: Jozef Hartinger
Attachments: helloworld.tar.gz, jboss-as-helloworld.war
Components: Scopes & Contexts
Created: 10/Jul/12 10:00 AM
Description:

SessionScoped Producers are called multiple times in the same session if a second request in the same session comes before the first one finishes.

The first request is thus processed with an outdated instance, as it will be replaced by the produce of the other request.

public class ShoppingCartProducer
{
   private static AtomicInteger ai = new AtomicInteger();
   
   @Produces
   @SessionScoped
   public ShoppingCart getShoppingCart() {
      System.out.println("getShoppingCart producer");
      
      try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); }
      
      return new ShoppingCart("cart" + ai.incrementAndGet());
   }
}
Environment: JBoss AS 7.1.2.Final
Fix Versions: 2.0.0.Alpha3
Project: Weld
Labels: backport_weld1x
Priority: Major Major
Reporter: Marek Schmidt
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira